Accents on capital letters (e.g., Ú) can get cut off
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
Steps (for Bill) to reproduce under Tux Paint Git master 2021-09-01 under Kubuntu 20.04
[Windows (Compose)] + ['], then [Shift] + [U]See discovery in https://sourceforge.net/p/tuxpaint/bugs/157/ (which itself relates to Greek accent composition problems under Windows).
I'm not seeing an easy way to determine when and why this happens, since SDL_Pango is a bit of a black box to me. (And the font code in Tux Paint is a bit spaghetti, since it supports both SDL_ttf (basic) and SDL_Pango (more complex)).
One thing I do notice is that the Greek translation of Tux Paint lacks any font weighting, so typing something like "UuÚúŲų" results in a mixed bag, as you apply different fonts. (e.g., sometimes you only get "UuÚú▯▯", and sometimes even just "Uu▯▯▯▯"... or some other nonsense.)
Compared to Chinese:
and Vietnamese:
(Using just the "QX" string as an example.)
Tagging @gunchleoc. BTW, I updated the Scottish Gaelic PO file to add some accented characters to a string to try and assist the font-sorting code within Tux Paint. See https://sourceforge.net/p/tuxpaint/tuxpaint/ci/fed3b8035995582f5cee996fd307b5977877b04f/
master is working correctly for me now :)
I've looked a little at this problem and found the FreeSans.ttf font we provide that has the problem you describe in the SDL1.2 version of Tux Paint, instead this problem vanishes in the SDL2 builds .
BTW, After added some printf()s here and there, seems the text and label tools only renders text with SDL_TTF and do not use Pango ?
It sounds like SDL_ttf for SDL 1.2 has a deficiency that SDL_ttf for SDL 2.0 has resolved...?
But also, oops, I guess we never utilized Pango with the Text and Label tools; I'll see whether that will be too complicated, or something I can fix easily... Thanks, Pere!
I had the idea to use SDL_ttf to open the TTF file (via it's filename, per
dirwalk), and attempt to load the font by family name via SDL_Pango, when possible (else, fallback to using SDL_ttf as we have done in the past).Unfortunately, I need to call it a night, and didn't get it working, but some code is there (wrapped in
#if 0 ... #endif) for experimentation.rendering like Arabic and Sinhala.
Sgrìobh William Kendrick na leanas 27/10/2021 aig 07:27:
Related
Bugs:
#232The crash seems to occur because there is some code here and there expecting a ttf_font in the tpf->ttf_font field, even if it is a Pango font.
For example in a loadfont_callback() debug printf() but there are others in the label code in tuxpaint.c that make labels not work.
I started looking into it, but definitely a lot of stuff (including the Labels tool) expects TTF fonts to be accessible, so I've given up for now. I'd like to get a new release out soon, switch to SDL2 and deal with the aftermath of that, before doing any major surgery. The fonts and dirwalk code is pretty complicated. :)
Tux Paint sdl2.0 branch today (2022-06-29 what will be 0.9.29) on Ubuntu 20.04.4 LTS works well. (I also tried creating a label with an accented character under SDL1.2 (master branch) build, saved it, loaded it into SDL2.0 build, and the text appeared correctly once I reactivated the label.)
I'll call this "fixed" by the SDL2.0 updates.