Char Extra and Breakchar Extra

The character-break-extra attribute provides a space value that increases or decreases the spacing for break characters in a string. The character-extra attribute provides a spacing value that increases or decreases the spacing between characters in a string. Since Japanese and Chinese do not use the break character in their text format, when application program wants to fill a string of text into a field which is longer than the text, the character-break-extra will not place the text correctly. On the other hand, the character-extra attribute will place the DBCS text to fit the field, because it applies to all characters. The APIs that relate to the character-extra and character-break-extra are GpiSetCharBreakExtra and GpiSetCharExtra. The Character Extra and break character extra in DBCS string shows the string before and after the character-break-extra or character-extra attribute are set.

SBCS Case:

  ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
  │B│r│e│a│k│ │c│h│a│r│ │e│x│t│r│a│ │ │   an SBCS string
  └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
                   │
                   
  ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
  │B│r│e│a│k│ │ │c│h│a│r│ │ │e│x│t│r│a│  defined the width of break character.
  └─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘  (Using GpiSetCharBreakExtra)


DBCS Case:

  ┌───┬───┬───┬───┬───┬─┬─┬─┬─┬─┬─┬─┬─┐
  │D│1│D│2│D│3│D│4│D│5│ │ │ │ │ │ │ │ │  a DBCS string
  └───┴───┴───┴───┴───┴─┴─┴─┴─┴─┴─┴─┴─┘
                   │
                   
  ┌───┬───┬───┬───┬───┬─┬─┬─┬─┬─┬─┬─┬─┐
  │D│1│D│2│D│3│D│4│D│5│ │ │ │ │ │ │ │ │  not effect if GpiSetCharBreakExtra is
  └───┴───┴───┴───┴───┴─┴─┴─┴─┴─┴─┴─┴─┘  called.
                   │
                   
  ┌───┬─┬─┬───┬─┬─┬───┬─┬─┬───┬─┬─┬───┐  define the spacing value between
  │D│1│ │ │D│2│ │ │D│3│ │ │D│4│ │ │D│5│  characters.
  └───┴─┴─┴───┴─┴─┴───┴─┴─┴───┴─┴─┴───┘  (Using GpiSetCharExtra)
Character Extra and break character extra in DBCS string

Note: The break character is defined by each font. The break character is an SBCS character. Normally, it is the SBCS space character or the character separator. The DBCS space character is not the break character. Therefore, if the break character extra is set to a string with DBCS space, then there is no change unless there are some SBCS space characters in it. There are no break character in Japanese and Chinese language, but in Korean language, the space character is a word separator and is defined as the break character.


[Back: Word Break and Punctuation]
[Next: Vertical Writing]