Menu

#232 Accents on capital letters (e.g., Ú) can get cut off

v0.9.26
closed
None
3
2022-06-29
2021-09-02
No

Steps (for Bill) to reproduce under Tux Paint Git master 2021-09-01 under Kubuntu 20.04

  • Switch to Text Tool
  • Accept default (first on the list) font
  • Type [Windows (Compose)] + ['], then [Shift] + [U]
  • The character "U" will appear; Expected: the character "Ú"
  • Change fonts; sometimes the ' will be visible (entirely, or cut off) at the top

See discovery in https://sourceforge.net/p/tuxpaint/bugs/157/ (which itself relates to Greek accent composition problems under Windows).

Related

Bugs: #232

Discussion

  • William Kendrick

    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:

    src/po/zh_CN.po:msgid "QX"
    src/po/zh_CN.po-msgstr "大写"
    ...
    src/po/zh_TW.po:msgid "QX"
    src/po/zh_TW.po-msgstr "正體中文"
    

    and Vietnamese:

    src/po/vi.po:msgid "QX"
    src/po/vi.po:msgstr "QXÀẢÃÁẠĂẰẲẴẮẶÂẦẨẪẤẬÈẺẼÉẸÊỀỂỄẾỆÌỈĨÍỊÒỎÕÓỌÔỒỔỖỐỘÙỦŨÚỤƯỪỬỮỨỰƠỜỞỠỚỢỲỶỸÝỴĐ"
    

    (Using just the "QX" string as an example.)

     
  • GunChleoc

    GunChleoc - 2021-09-03

    master is working correctly for me now :)

     
  • Pere Pujal i Carabantes

    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 ?

     
    • William Kendrick

      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!

       
      • William Kendrick

        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.

         
        • GunChleoc

          GunChleoc - 2021-10-27
          • for Pango, it has better support for languages with complicated
            rendering like Arabic and Sinhala.

          Sgrìobh William Kendrick na leanas 27/10/2021 aig 07:27:

          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.


          [bugs:#232] https://sourceforge.net/p/tuxpaint/bugs/232/ Accents on
          capital letters (e.g., Ú) can get cut off

          Status: open
          Group: v0.9.26
          Created: Thu Sep 02, 2021 06:44 AM UTC by William Kendrick
          Last Updated: Wed Oct 27, 2021 04:59 AM UTC
          Owner: William Kendrick

          Steps (for Bill) to reproduce under Tux Paint Git master 2021-09-01
          under Kubuntu 20.04

          • Switch to Text Tool
          • Accept default (first on the list) font
          • Type |[Windows (Compose)]| + |[']|, then |[Shift]| + |[U]|
          • The character "U" will appear; Expected: the character "Ú"
          • Change fonts; sometimes the ' will be visible (entirely, or cut off)
            at the top

          See discovery in https://sourceforge.net/p/tuxpaint/bugs/157/
          https://sourceforge.net/p/tuxpaint/bugs/157/ (which itself relates to
          Greek accent /composition/ problems under Windows).


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/tuxpaint/bugs/232/
          https://sourceforge.net/p/tuxpaint/bugs/232/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs: #232

        • Pere Pujal i Carabantes

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

           
          • William Kendrick

            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. :)

             
  • William Kendrick

    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.

     
  • William Kendrick

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB