Usually a chinese character occupies twice the width of an ascii
character in fixed width fonts.  You may add some logic to test for
a CJK characters (range 4E00–9FFF and 3400–4DBF)

http://en.wikipedia.org/wiki/CJK_Unified_Ideographs

to estimate the width if they all were ascii.

Втр, 16 Окт 2012, Ian Clark писал(а):
> Has anyone else felt the need to display a boxed noun which contains
> Unicode glyphs?
> 
> Such as:
>    < u: 9017 32 9054
> You'll know that the box structure breaks up, because J wants to treat
> '⌹' as 3 letters, whereas it only takes up one glyph on the screen.
> 
> Check out my new (beta) Addon: format/sbox, which lets you input (say):
>    require 'format/sbox'
>    sbox < u: 9017 32 9054
> for a corrected display.
> 
> Read the write-up at: http://www.jsoftware.com/jwiki/Addons/format/sbox
> 
> A Lab gets installed with the Addon:
>     Category: Format
>     Lab: Displaying boxed nouns containing Unicode glyphs
> 
> There's also a test/demo script:
>    load 'format/sbox/test'
> 
> IanClark
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

-- 
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to