At this point we've decided to ignore the problem with unicode (and the related, but more general problem of variable pitch) in box draw. The problem comes in degress and the question is where to draw the line. If the utf-8 2 byte chars are European in a fixed pitch font then your suggestion of counting glyphs works. If the utf-8 2 byte chars are Chinese in a fixed pitch font that takes 2 positions for the Chinese chars then the current scheme of counting bytes works. In cases where the font is not fixed pitch or there is a mix of languages then things get much more complicated. The proper solution is to have the box drawing done in the front end where the actual length of each contents is calculated and the box lines are drawn with graphics. This is a lot of work for what we consider to be seriously diminished returns.

Use box draw for simple exposition with appropriate data. For more complicated things do the display in a grid or use other workarounds (e.g., converting to html tables etc).

----- Original Message ----- From: "Andrew Nikitin" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, June 16, 2006 7:46 PM
Subject: [Jbeta] boxed unicode


Hello,

Beta-o (and beta-n, if it matters) does not calculate right amount of horizontal bars to draw boxed unicode. I understand, there is still a problem with double-wide characters, but if box size was taken to be number of graphemes rather than number of bytes it would look right in most cases.

  'sâ?(+/Ï?)÷ρÏ?'
sâ?(+/Ï?)÷ρÏ?
  <'sâ?(+/Ï?)÷ρÏ?'
â"Oâ"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"
â",sâ?(+/Ï?)÷ρÏ?â",
â""â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"~
  $7 u:'sâ?(+/Ï?)÷ρÏ?'
10
  $'sâ?(+/Ï?)÷ρÏ?'
16
  <7 u:'sâ?(+/Ï?)÷ρÏ?'
â"Oâ"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"
â",sâ?(+/Ï?)÷ρÏ?â",
â""â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"~
  <16$'-'
â"Oâ"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"
â",----------------â",
â""â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"~
  <10$'-'
â"Oâ"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"
â",----------â",
â""â"?â"?â"?â"?â"?â"?â"?â"?â"?â"?â"~


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to