diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-16 20:27:05 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-10-16 20:27:19 +0000 |
| commit | 398d69e9d27bd5e0a8db85cc799478534b9db52f (patch) | |
| tree | c67272018aeee0eecea32681116d5d5392659c6f /src/libnrtype | |
| parent | Update properties for SVG 2 text. Partial work from Alex Roman (diff) | |
| download | inkscape-398d69e9d27bd5e0a8db85cc799478534b9db52f.tar.gz inkscape-398d69e9d27bd5e0a8db85cc799478534b9db52f.zip | |
Revive pango_win32 backend
With these changes it's compiling and rendering text, however there
seems to be an issue with setting font styles (e.g. font size is not
set properly initially).
OpenType font features are not supported.
See https://bugs.launchpad.net/inkscape/+bug/1416674 for some history
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 2 | ||||
| -rw-r--r-- | src/libnrtype/FontInstance.cpp | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index e160fc277..b2baeb2f0 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -634,6 +634,7 @@ void extract_openTypeTables(font_instance *res) { // Empty map... bitmap fonts seem to be loaded multiple times. res->openTypeTables.clear(); +#ifndef USE_PANGO_WIN32 auto const face = hb_ft_face_create(res->theFace, NULL); // First time to get size of array @@ -771,6 +772,7 @@ void extract_openTypeTables(font_instance *res) { hb_face_destroy (face); g_free(scripts_hb); +#endif // USE_PANGO_WIN32 } font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail) diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 7a16fc0c3..57aa22d48 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -556,10 +556,10 @@ bool font_instance::FontDecoration( double &underline_position, double &underl return false; } double scale=1.0/parent->fontSize; - underline_position = fabs(otm.otmUnderscorePosition *scale); - underline_thickness = fabs(otm.otmUnderscoreSize *scale); - linethrough_position = fabs(otm.otmStrikeoutPosition *scale); - linethrough_thickness = fabs(otm.otmStrikeoutSize *scale); + underline_position = fabs(otm.otmsUnderscorePosition *scale); + underline_thickness = fabs(otm.otmsUnderscoreSize *scale); + linethrough_position = fabs(otm.otmsStrikeoutPosition *scale); + linethrough_thickness = fabs(otm.otmsStrikeoutSize *scale); #else if ( theFace->units_per_EM == 0 ) { return false; // bitmap font @@ -683,12 +683,12 @@ void font_instance::FindFontMetrics() { if ( theFace ) { #ifdef USE_PANGO_WIN32 - + OUTLINETEXTMETRIC otm; if ( GetOutlineTextMetrics(parent->hScreenDC,sizeof(otm),&otm) ) { double scale=1.0/parent->fontSize; _ascent = fabs(otm.otmMacAscent * scale); _descent = fabs(otm.otmMacDescent * scale); - _xheight = fabs(otm.otmXHeight * scale); + _xheight = fabs(otm.otmsXHeight * scale); _ascent_max = fabs(otm.otmAscent * scale); _descent_max = fabs(otm.otmDescent * scale); |
