slang-users mailing list

[2013 Date Index] [2013 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] width of UTF-8 text in columbs


SLutf8_strlen() returns the number of Unicode characters.
One or more of these Unicode characters could be rendered on the
screen over 2 columns, for example many Chinese characters.
When fitting a box around a list of words (like in a menu), it would
be nice to know the width of a string in columns.
I could not find any clear answers to which Unicode ranges are
rendered as two columns, so looking at the actual font files could be
the only correct solution.
As a workaround, I could just write each word to the (virtual) screen,
and request the new cursor position.

I'm new to slang, so I may have overlooked a simpler solution.
Has anyone encountered this situation before?

With kind regards,
Jaap



[2013 date index] [2013 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]