Some of oriental characters in Japanese and Korean are usually
aligned as if they have 2 columns per character.  Jperl has been
patched on format built-in so that Japanese characters get
special treatments:
  - 2-byte characters occupy 2 columns
    * this assumption is not strictly correct, but good enough
      for practical use.
  - don't split a 2-byte character in the middle
    * pad a space if necessary
    * ellipses might be changed to "... " instead of "..."
  - text is breakable before or after a 2-byte character,
    regardless of $FORMAT_LINE_BREAK_CHARACTERS.
    * possible breakpoints between 1-byte characters are the
      same as the original Perl.

Japanese has another formatting rule that punctuation characters
cannot appear at the beginning of or end of line (depending on
their meanings).  This rule is not implemented in Jperl.  Most
text-formatting programs like web browsers neither have this
"disabling rules".  Commercial word-processing/DTP's and the
Mule editor (multi-lingual Emacs) have.

I have two ideas:
  - User-specifiable break sub (as in Text::Autosplit) looks
    after all of above.  Expensive at runtime.
  - A small lookup-table which maps a charcter to its width.
    A user-specified table may provide proportional formatting.
Japanese would set the lookup-table so that Kanji characters
have twice as wide as ASCII; this would produce the same output
as current Jperl.  Those who need disabling rules would use
their own break function for better output, others would leave
it default for speed.

Hmm... Text::Autosplit::replace has hard-coded
split-on-whitespace loop.  I'm not sure but this may cause
"disabled at end-of-line" characters at eol.

                                                         ____
-------------------------------  Avatar          Md+   d/ HH \.   Md+
   Kaoru "Mad Player" MAEDA      75t 145km/h   AFC50  O \#oo#/ "  LG+ LG+
       [EMAIL PROTECTED]        HeatSink 13   LRM10   .=X~~X=.   LRM10
-------------------------------  Armor 19.5t     Md+  _|_    _|_  Md+

Reply via email to