summaryrefslogtreecommitdiff
path: root/pango/pangowin32-fontmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-12-16 03:24:07 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-12-16 03:24:07 +0000
commit7be7952f2fb1d34963a041fc9bc4d4841d8de74a (patch)
treed6417d999b1f4a7a38290eb94004934fe57d1163 /pango/pangowin32-fontmap.c
parentda045342eccab09d3d6be33b1b65ebeb5dc2b2f0 (diff)
downloadpango-7be7952f2fb1d34963a041fc9bc4d4841d8de74a.tar.gz
Add pixel sizes for fonts (#119081, patch from Chris Lahey)
Wed Dec 15 22:09:42 2004 Owen Taylor <otaylor@redhat.com> Add pixel sizes for fonts (#119081, patch from Chris Lahey) * pango/fonts.c pango/pango-font.h: Add pango_font_description_set_absolute_size(), pango_font_description_get_size_is_absolute() * pango/pango-attributes.[ch]: Add pango_attr_size_new_absolute(), change PANGO_ATTR_SIZE from PangoAttrInt to PangoAttrSize (preserves compat because first component is identical) * pango/pangowin32-fontmap.c (pango_win32_font_map_load_font): For absolute sizes, convert pixels to points, before calling pango_win32_font_new(). * pango/pangofc-fontmap.c pango/pangoft2.c pango/pangoxft-font.c: Handle absolute sizes.
Diffstat (limited to 'pango/pangowin32-fontmap.c')
-rw-r--r--pango/pangowin32-fontmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index 66053356..92bf7f64 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -449,6 +449,9 @@ pango_win32_font_map_load_font (PangoFontMap *fontmap,
GSList *tmp_list = best_match->cached_fonts;
gint size = pango_font_description_get_size (description);
+ if (pango_font_description_get_size_is_absolute (description))
+ size = (int) 0.5 + (size * win32fontmap->resolution) / PANGO_SCALE;
+
PING(("got best match:%s size=%d",best_match->logfont.lfFaceName,size));
while (tmp_list)