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 08:33:47
|
Tuxpaint-devel only... On Sun, Nov 14, 2021 at 12:29:39AM -0800, Bill Kendrick wrote: > > While playing with tuxpaint-config, I noticed that some > of Shin-ichi's translations were wrapping oddly. > I discovered the translated strings contained "\n" within > them, meaning they were hard-wrapping. I discovered FLTK > did NOT soft-wrap such strings if they were too wide. <snip> > > So I Googled around, and discovered libtextwrap > (http://libtextwrap.sourceforge.net/) which can handle this. > Since we're using a GUI, and some text in the Japanese translation > include non-Japanese characters (e.g., "Control-S", or "0-32766"), > rather than attempt to determine the proper column width to wrap at, > I have Tux Paint Config. brute-force it, by wrapping one character > earlier and earlier until everything fits (per `fl_measure()`). <snip> Oh, one other thing to point out... Since we're setting the labels' strings once, at launch, this means the Japanese (and any other locales affected by this) will NOT automatically respond to changes in the window size, like they do for other locales. Of course, this was already the case, so it's not a regression. It's just something we COULD handle ourselves, but do not at this time. In the end, because the app was not originally written to be "responsive", we're having to deal with a lot of this junk ourselves. I should buy a book on Qt or GTK+ and rewrite this poor old thing. (It just had it's 19th birthday a couple days ago! :^D ) -bill! |