diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2018-08-16 11:52:01 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2018-08-16 11:52:01 +0000 |
| commit | d23286cc56cbbf051445f906083deeeae731534b (patch) | |
| tree | f659888a191a13b89fd1ecf13a44492e3769ec8c /src/libnrtype | |
| parent | Relative values for strokes: (diff) | |
| download | inkscape-d23286cc56cbbf051445f906083deeeae731534b.tar.gz inkscape-d23286cc56cbbf051445f906083deeeae731534b.zip | |
Fix wrong initial glyph size with native pango_win32 font backend
Turns out somebody (likely cairo or pango) calls SetWorldTransform()
during initialization without resetting it. This resulted in the
font selected on startup having a wrong (tiny) glyph size.
Work around this by explicitly setting the "WorldTransform" again
when subsequently selecting the font.
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontInstance.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 733eb4dd5..d7a90bcd4 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -288,6 +288,16 @@ void font_instance::InitTheFace() FindFontMetrics(); } + +#ifdef USE_PANGO_WIN32 + // Someone (probably pango or cairo) sets the world transform during initialization and does not reset it. + // Work around this by explicitly setting it again (even if the font is already initialized) + XFORM identity = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; + SetWorldTransform(parent->hScreenDC, &identity); + SetGraphicsMode(parent->hScreenDC, GM_COMPATIBLE); + SelectObject(parent->hScreenDC,theFace); +#endif + } void font_instance::FreeTheFace() |
