summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorRichard Hughes <cyreve@gmail.com>2006-11-26 18:34:15 +0000
committercyreve <cyreve@users.sourceforge.net>2006-11-26 18:34:15 +0000
commit55086033ce337a7df17d45dd11649034213cbf16 (patch)
treecb0c5e75c29d38d834629e23db863b82f6b0734e /src/libnrtype
parentmake update-po works again (diff)
downloadinkscape-55086033ce337a7df17d45dd11649034213cbf16.tar.gz
inkscape-55086033ce337a7df17d45dd11649034213cbf16.zip
bug 1602461: never use font-stretch on win32 because Pango/GDI don't support it so will end up falling back to Arial always
(bzr r2041)
Diffstat (limited to 'src/libnrtype')
-rwxr-xr-xsrc/libnrtype/Layout-TNG-Input.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp
index b99107885..295b062a2 100755
--- a/src/libnrtype/Layout-TNG-Input.cpp
+++ b/src/libnrtype/Layout-TNG-Input.cpp
@@ -290,14 +290,18 @@ PangoFontDescription *Layout::InputStreamTextSource::styleGetFontDescription() c
pango_font_description_set_family(descr,family.c_str());
pango_font_description_set_weight(descr,(PangoWeight)_enum_converter(style->font_weight.computed, enum_convert_spstyle_weight_to_pango_weight, sizeof(enum_convert_spstyle_weight_to_pango_weight)/sizeof(enum_convert_spstyle_weight_to_pango_weight[0])));
- pango_font_description_set_stretch(descr,(PangoStretch)_enum_converter(style->font_stretch.computed, enum_convert_spstyle_stretch_to_pango_stretch, sizeof(enum_convert_spstyle_stretch_to_pango_stretch)/sizeof(enum_convert_spstyle_stretch_to_pango_stretch[0])));
pango_font_description_set_style(descr,(PangoStyle)_enum_converter(style->font_style.computed, enum_convert_spstyle_style_to_pango_style, sizeof(enum_convert_spstyle_style_to_pango_style)/sizeof(enum_convert_spstyle_style_to_pango_style[0])));
pango_font_description_set_variant(descr,(PangoVariant)_enum_converter(style->font_variant.computed, enum_convert_spstyle_variant_to_pango_variant, sizeof(enum_convert_spstyle_variant_to_pango_variant)/sizeof(enum_convert_spstyle_variant_to_pango_variant[0])));
#ifdef USE_PANGO_WIN32
// damn Pango fudges the size, so we need to unfudge. See source of pango_win32_font_map_init()
pango_font_description_set_size(descr, (int) ((font_factory::Default())->fontSize*PANGO_SCALE*72/GetDeviceCaps(pango_win32_get_dc(),LOGPIXELSY))); // mandatory huge size (hinting workaround)
+ // we don't set stretch on Win32, because pango-win32 has no concept of it
+ // (Windows doesn't really provide any useful field it could use).
+ // If we did set stretch, then any text with a font-stretch attribute would
+ // end up falling back to Arial.
#else
pango_font_description_set_size(descr, (int) ((font_factory::Default())->fontSize*PANGO_SCALE)); // mandatory huge size (hinting workaround)
+ pango_font_description_set_stretch(descr,(PangoStretch)_enum_converter(style->font_stretch.computed, enum_convert_spstyle_stretch_to_pango_stretch, sizeof(enum_convert_spstyle_stretch_to_pango_stretch)/sizeof(enum_convert_spstyle_stretch_to_pango_stretch[0])));
#endif
return descr;
}