Board index » delphi » DrawText() - DT_NOFULLWIDTHCHARBREAK

DrawText() - DT_NOFULLWIDTHCHARBREAK


2003-12-03 12:33:20 AM
delphi230
I've had an issue with TTntLabel where the word breaking for Asian
characters seemed to be way off. I added the DT_NOFULLWIDTHCHARBREAK a few
months ago, and this seemed to solve the problem. Just today I received
feedback that removing this flag made Chinese characters wrap correctly.
The Platform SDK says this: "Prevents a line break at a double-byte
character set (DBCS), so that the line-breaking rule is equivalent to
single-byte character set (SBCS). This can be used, for example, to make
icon labels written in Korean text more readable."
Can anybody please provide insight into this. Is this flag never desirable,
always desireable or only sometimes desireable? Should this be an option?
TLabel never uses the NOFULLWIDTHCHARBREAK flag. Does TLabel incorreclty
wrap some Asian languages?
--Troy
 
 

Re:DrawText() - DT_NOFULLWIDTHCHARBREAK

Hi, Troy,
It's better not using this flag, in my opinion. Standard VCL TLabel has
no problem wrapping Chinese text. With this flag on, DrawTextW cannot
break Chinese characters correctly. Unlike Latin text, CJK words are not
separated by spaces (actually, word segmentation in CJK is by itself a
research area in AI, usually with the help of predefined dictionaries).
DT_NOFULLWIDTHCHARBREAK will force DrawText to break words only at
spaces so that CJK text will have the same semantics as Latin text,
which is NOT so good, generally speaking.
Francisco
Troy Wolbrink writes:
Quote
I've had an issue with TTntLabel where the word breaking for Asian
characters seemed to be way off. I added the DT_NOFULLWIDTHCHARBREAK a few
months ago, and this seemed to solve the problem. Just today I received
feedback that removing this flag made Chinese characters wrap correctly.

The Platform SDK says this: "Prevents a line break at a double-byte
character set (DBCS), so that the line-breaking rule is equivalent to
single-byte character set (SBCS). This can be used, for example, to make
icon labels written in Korean text more readable."

Can anybody please provide insight into this. Is this flag never desirable,
always desireable or only sometimes desireable? Should this be an option?
TLabel never uses the NOFULLWIDTHCHARBREAK flag. Does TLabel incorreclty
wrap some Asian languages?
 

Re:DrawText() - DT_NOFULLWIDTHCHARBREAK

Thanks for your input. The DT_NOFULLWIDTHCHARBREAK flag will be removed
from TTntLabel.
--Troy
"FL" <XXXX@XXXXX.COM>writes
Quote
Hi, Troy,

It's better not using this flag, in my opinion. Standard VCL TLabel has
no problem wrapping Chinese text. With this flag on, DrawTextW cannot
break Chinese characters correctly. Unlike Latin text, CJK words are not
separated by spaces (actually, word segmentation in CJK is by itself a
research area in AI, usually with the help of predefined dictionaries).
DT_NOFULLWIDTHCHARBREAK will force DrawText to break words only at
spaces so that CJK text will have the same semantics as Latin text,
which is NOT so good, generally speaking.

Francisco

Troy Wolbrink writes:

>I've had an issue with TTntLabel where the word breaking for Asian
>characters seemed to be way off. I added the DT_NOFULLWIDTHCHARBREAK a
few
>months ago, and this seemed to solve the problem. Just today I received
>feedback that removing this flag made Chinese characters wrap correctly.
>
>The Platform SDK says this: "Prevents a line break at a double-byte
>character set (DBCS), so that the line-breaking rule is equivalent to
>single-byte character set (SBCS). This can be used, for example, to make
>icon labels written in Korean text more readable."
>
>Can anybody please provide insight into this. Is this flag never
desirable,
>always desireable or only sometimes desireable? Should this be an
option?
>TLabel never uses the NOFULLWIDTHCHARBREAK flag. Does TLabel
incorreclty
>wrap some Asian languages?