FreeType-backend procudes wrong unicode special characters on some systems (because of localization settings?)

View: New views
2 Messages — Rating Filter:   Alert me  

FreeType-backend procudes wrong unicode special characters on some systems (because of localization settings?)

by jstuehmer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

after I switched the pango-cairo backend to freetype, I get very nice Font rendering output under win32. Thanks to everyone developing Pango!

But since I switched to the FT backend I'm experiencing problems when rendering unicode special characters.
Special characters in the text, that should be rendered, are represented like #xE4; with UTF8-encoding.
Before I switched to Freetype the text encoding was fine, but now some single special characters (not the standard ASCII set) are represented with wrong single characters.

However, I don't experience this problem on all systems. Could it depend on the localization-settings of the windows system?
I don't have problems on a US-English system, but get wrong special character substitution on a German system. However this is just a guess and I couldn't ty yet to change the settings of that machine.

To switch to FT I use the following code snippet (was originally postetd by Behdad Esfahbod)

      PangoFontMap* fontmap = pango_cairo_font_map_get_default ();
      if (pango_cairo_font_map_get_font_type ((PangoCairoFontMap*)(fontmap)) != CAIRO_FONT_TYPE_FT)
        {
          PangoFontMap* ftfontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
          if (ftfontmap)
            fontmap = ftfontmap;
          else
            fontmap = static_cast<PangoFontMap*>(g_object_ref (fontmap));
        }
      else
        fontmap = static_cast<PangoFontMap*>(g_object_ref (fontmap));
      pango_cairo_font_map_set_default ((PangoCairoFontMap*)(fontmap));


I'm using Pango 1.24.5 with Cairo 1.8.8 binaries from the GTK+2.0 win32 binary package with MSYS/MinGW.

Thank you for your advice,
 Jan Stühmer

--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list

Re: FreeType-backend procudes wrong unicode special characters on some systems (because of localization settings?)

by Behdad Esfahbod-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jan,

Sounds like charset issue, yes.  How are you processing the text?  Is it
coming from the command line?  If you write the code in C and pass the text
directly to pango_layout_set_text(), you shouldn't have any problem.  Guess
people more familiar with GTK+ on win32 can help you better.

behdad

On 09/12/2009 05:48 AM, "Jan Stühmer" wrote:

> Hi all,
>
> after I switched the pango-cairo backend to freetype, I get very nice Font rendering output under win32. Thanks to everyone developing Pango!
>
> But since I switched to the FT backend I'm experiencing problems when rendering unicode special characters.
> Special characters in the text, that should be rendered, are represented like #xE4; with UTF8-encoding.
> Before I switched to Freetype the text encoding was fine, but now some single special characters (not the standard ASCII set) are represented with wrong single characters.
>
> However, I don't experience this problem on all systems. Could it depend on the localization-settings of the windows system?
> I don't have problems on a US-English system, but get wrong special character substitution on a German system. However this is just a guess and I couldn't ty yet to change the settings of that machine.
>
> To switch to FT I use the following code snippet (was originally postetd by Behdad Esfahbod)
>
>        PangoFontMap* fontmap = pango_cairo_font_map_get_default ();
>        if (pango_cairo_font_map_get_font_type ((PangoCairoFontMap*)(fontmap)) != CAIRO_FONT_TYPE_FT)
>          {
>            PangoFontMap* ftfontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT);
>            if (ftfontmap)
>              fontmap = ftfontmap;
>            else
>              fontmap = static_cast<PangoFontMap*>(g_object_ref (fontmap));
>          }
>        else
>          fontmap = static_cast<PangoFontMap*>(g_object_ref (fontmap));
>        pango_cairo_font_map_set_default ((PangoCairoFontMap*)(fontmap));
>
>
> I'm using Pango 1.24.5 with Cairo 1.8.8 binaries from the GTK+2.0 win32 binary package with MSYS/MinGW.
>
> Thank you for your advice,
>   Jan Stühmer
>
_______________________________________________
gtk-i18n-list mailing list
gtk-i18n-list@...
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list