Re: [Tuxpaint-devel] Using libtextwrap in Tux Paint Config.
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2021-11-14 21:51:18
|
On Sun, Nov 14, 2021 at 01:42:12PM -0800, Bill Kendrick wrote:
<snip>
> Another thought is perhaps using ZERO WIDTH SPACE (U+200B)
> within the translation, as hints for where FLKT can word-wrap.
>
> (1) That assumes that FLTK will even do the right thing; I'll
> experiment with it a little.
It rendered them as a rectangle-with-an-X symbol.
Another thought, which would have the same problem as (2), below,
would be to invent our own "mark-up" for the translated labels,
and implement a very simple word-wrap, not relying on this
hard-to-get & unmaintained library.
So for example, instead of a ZWS Unicode character, a
string like "{zws}" or maybe even just "{}" or some other symbol
not regularly used in the labels, like "~".
We would normally strip them all out, but replace them with spaces
(to allow FLTK to word-wrap) or "\n" (as Shin-ichi had done manually)
only when they are useful to word-wrap.
So for example
X~YZ~X~Y~ZXYZ.
And this would allow us to word wrap AS IF the text was:
X YZ X Y ZXYZ.
But render it more appropriately (with no spaces), say either:
XYZXY
ZXYZ.
or:
XYZXYZXYZ.
depending on the space available.
For this, we would still need the new "measure_and_softwrap()",
but it would be 100% our own code, rather than relying on
`libtextwrap`.
> (2) This will require inserting a LOT of these characters
> within the translated text itself. Shin-ichi and others
> that might maintain the Japanese translation of Tux Paint Config.,
> and maintainers of other similarly-affected languages
> (e.g., Thai), may not appreciate having to do this. :-)
I suppose one wouldn't have to introduce them EVERYWHERE,
but only where it seems useful, based on how things look in the UI
(not unlike how "\n" had been used, but a bit more liberally).
-bill!
|