diff options
author | Hans Breuer <hans@breuer.org> | 2006-06-05 16:29:19 +0000 |
---|---|---|
committer | Hans Breuer <hans@src.gnome.org> | 2006-06-05 16:29:19 +0000 |
commit | 4590a9287d0d1e085c089b0b339afe30caabfcea (patch) | |
tree | a789bbbc677e38f07f590f2857ced1c79e98912a /pango | |
parent | 9663ade3f376a00f8d66daf3ad7c89a1b521da16 (diff) | |
download | pango-4590a9287d0d1e085c089b0b339afe30caabfcea.tar.gz |
not only handle PANGO_GLYPH_EMPTY but also PANGO_GLYPH_UNKNOWN_FLAG. The
2006-05-05 Hans Breuer <hans@breuer.org>
* pango/pangocairo-win32font.c(compute_glyph_extents) : not only
handle PANGO_GLYPH_EMPTY but also PANGO_GLYPH_UNKNOWN_FLAG.
The latter is needed to have proper sizing of the "hex box" for
missing glyphs. It also stops cairo complaining about unknown glyphs.
Fixes part of bug #343796.
* pango/makefile.msc : create $(PRJ_TOP)\config.h.win32. (Not
changing in years does not necessarily mean it is not used)
* pango/testfonts.c : make family_name survive
pango_font_description_free(), it is used later on
Diffstat (limited to 'pango')
-rw-r--r-- | pango/makefile.msc | 4 | ||||
-rw-r--r-- | pango/pangocairo-win32font.c | 11 | ||||
-rw-r--r-- | pango/testfonts.c | 8 |
3 files changed, 19 insertions, 4 deletions
diff --git a/pango/makefile.msc b/pango/makefile.msc index 0e3d8d42..4962b38d 100644 --- a/pango/makefile.msc +++ b/pango/makefile.msc @@ -185,6 +185,8 @@ OBJECTS = \ !ENDIF !IFDEF OBJS_querymodules +PKG_CFLAGS = $(PKG_CFLAGS) \ + -DPACKAGE_NAME=\"Pango\" -DPACKAGE_VERSION=\"$(PANGO_VER)\" OBJECTS = \ querymodules.obj !ENDIF @@ -249,6 +251,8 @@ lib$(PACKAGE)-$(PKG_VER)-0.dll : $(OBJECTS) $(PKG_DEF) $(PRJ_TOP)\config.h $(PACKAGE).exe : $(PKG_LINK) $(OBJECTS) $(CC) $(CFLAGS) -Fe$(PACKAGE).exe $(OBJECTS) $(PKG_LINK) gdi32.lib user32.lib +$(PRJ_TOP)\config.h.win32 : makefile.msc + echo /*empty*/ > $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32 copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h diff --git a/pango/pangocairo-win32font.c b/pango/pangocairo-win32font.c index 53ced191..ddfe0340 100644 --- a/pango/pangocairo-win32font.c +++ b/pango/pangocairo-win32font.c @@ -212,7 +212,16 @@ compute_glyph_extents (PangoFont *font, logical_rect->width = 0; logical_rect->height = (font_extents.ascent + font_extents.descent) * PANGO_SCALE; - if (glyph != PANGO_GLYPH_EMPTY) + if (glyph == PANGO_GLYPH_EMPTY) + { + /* already initialized above */ + } + else if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + /* space for the hex box */ + _pango_cairo_get_glyph_extents_missing(cfont, glyph, ink_rect, logical_rect); + } + else { cairo_glyph.index = glyph; cairo_glyph.x = 0; diff --git a/pango/testfonts.c b/pango/testfonts.c index a3674a03..8586a01a 100644 --- a/pango/testfonts.c +++ b/pango/testfonts.c @@ -66,7 +66,7 @@ int main (int argc, char **argv) PangoFontFamily** families = NULL; PangoFontFace** faces = NULL; int nb, i; - const gchar* family_name = NULL; + gchar* family_name = NULL; PangoLanguage *lang = pango_language_from_string (g_win32_getlocale ()); HDC hdc = NULL; int line = 0; @@ -115,7 +115,7 @@ int main (int argc, char **argv) } desc = pango_font_description_from_string(s->str); - family_name = pango_font_description_get_family (desc); + family_name = g_strdup (pango_font_description_get_family (desc)); font = pango_font_map_load_font (fontmap, context, desc); @@ -139,7 +139,7 @@ int main (int argc, char **argv) /* Get on the family faces. No simple way ? */ for (i = 0; i < nb; i++) { - if (0 == strcmp (pango_font_family_get_name (families[i]), family_name)) + if (0 == g_ascii_strcasecmp (pango_font_family_get_name (families[i]), family_name)) { pango_font_family_list_faces (families[i], &faces, &nb); /* now nb is the number of faces */ @@ -148,6 +148,8 @@ int main (int argc, char **argv) } g_free (families); families = NULL; + g_free (family_name); + family_name = NULL; } hdc = pre_render(my_font_size * 64, 3 * my_font_size * nb / 2); |