GNOME Bugzilla – Bug 149643
pango-basic-win32 doesn't always load metrics? (Symbol font)
Last modified: 2005-07-05 10:51:15 UTC
* pango-1.4.0 from http://www.gimp.org/~tml/gimp/win32/downloads.html * With PyGTK: import gtk import pango fd = pango.FontDescription("symbol 12") w = gtk.Window() f = w.get_pango_context().load_font(fd) f.get_metrics() Results in: (:2868): GLib-GObject-CRITICAL **: file gobject.c: line 1561 (g_object_ref): assertion `G_IS_OBJECT (object)' failed ** (:2868): CRITICAL **: file pango-engine.c: line 68 (_pango_engine_shape_shape): assertion `PANGO_IS_FONT (font)' failed Or when you set the font for a widget to Symbol, you get this message box: ** Error: ** file shape.c: line 75 (pango_shape): assertion failed: (glyphs->num_glyphs > 0) aborting... This only seems to happen with fonts that contain symbols, such as Symbol and Wingdings.
This also happens under Pango 1.4.1 and using a plain C gtk application. If necessary, i can throw together a sample application that easily replicates the issue, but it can easily be replicated in Gimp or Gaim by simply trying to use the Symbol font. I guess that the worst part about this issue is that it causes the whole application to exit - it seems that this problem could be handled more elegantly.
*** Bug 152473 has been marked as a duplicate of this bug. ***
Fixed in HEAD and pango-1-4: 2004-09-15 Tor Lillqvist <tml@iki.fi> * pango/pangowin32-fontmap.c (pango_win32_insert_font): Ignore fonts in SYMBOL_CHARSET. They don't have any Unicode mapping table. (#152473)
So we don't get to use these at all? I have a music notation TTF which I'd like to use. It works fine with Freetype on Linux, but won't work on Win32 because of the lack of a Unicode mapping. Tor, I can look into producing a patch for this if you like.
The fix was to the pangowin32 backend. No FreeType involved at all there. How does that music notation font work on Linux? How does Pango work with a font that has no Unicode mapping? Just assign some random mapping from Unicode characters to glyphs in the font? What software do you use that font with, is Pango involved at all? Or even GTK+?
Actually, Pango (well, more, fontconfig) cna handle fonts with the Adobe symbol encoding. But it can't use a font with no recognized encoding table, unless you use the PangoFcDecoder functionality in Pango-1.6.
In this particular case, I copied the TTF file from my Windows box to my Debian box, and ran the same PyGTK program on both. It worked on the Debian box, but not on the Windows box. The difference, as far as I can tell, is that the Freetype backend somehow produces a mapping (most likely just ordinal 1:1), while the Win32 backend barfs. It looks like I'll have to dig into the libft2 code to figure out what exactly is going on. Just reporting what I've observed. I'll do a more scientific check and identify the versions involved when I get home tonight.
*** Bug 150653 has been marked as a duplicate of this bug. ***
*** Bug 148169 has been marked as a duplicate of this bug. ***
*** Bug 151068 has been marked as a duplicate of this bug. ***
*** Bug 300399 has been marked as a duplicate of this bug. ***
*** Bug 309311 has been marked as a duplicate of this bug. ***