Summary: Fixed-width tables look bad with wide characters
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Fri Dec 10 20:05:34 2010
                Category: client
                Severity: 2 - Minor
                Priority: 3 - Low
                  Status: Confirmed
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None
         Planned Release: 



Follow-on to bug #17215 and bug #17246:

There are a few places where tables of data are displayed in a fixed-width
typeface, relying on spacing for alignment, in a way that translators have no
control over.

When "wide" characters are used (as in the Japanese localisation, for
instance), the alignment is off.

This is due to use of get_internal_string_length() as a proxy for screen
width. This counts the number of characters (rather than bytes), which is fine
for single-width characters, but it does not take character width into

To fix this we need to use something like wcwidth()
<http://www.opengroup.org/onlinepubs/009695399/functions/wcwidth.html>, which
counts the actual number of columns a string takes in a fixed-width font,
based on character properties defined in the Unicode standard. I'm not sure
how widely available it is; perhaps it's a prerequisite of something we
already depend on, although I suspect it's won't be available on Windows at
least. If not we could instead incorporate Markus Kuhn's implementation

There may be some hassle integrating it with Freeciv's character set
arrangements, since it works with the native wchar_t.

(Or we could get rid of the need for aligned fixed-width text, but that's
still a chunk of work.)


Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to