URL:
  <http://gna.org/bugs/?17289>

                 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
                 Release: 
         Discussion Lock: Any
        Operating System: None
         Planned Release: 

    _______________________________________________________

Details:

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
account.

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
<http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c>.

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:

  <http://gna.org/bugs/?17289>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to