diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-13 15:40:39 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-01-13 15:40:39 +0000 |
| commit | 979914865d4db2debe2f86059f11e4b93a266fb9 (patch) | |
| tree | 12204531949a4c4aa76deb4941803150eaf5b1f3 /src | |
| parent | Translations: (diff) | |
| download | inkscape-979914865d4db2debe2f86059f11e4b93a266fb9.tar.gz inkscape-979914865d4db2debe2f86059f11e4b93a266fb9.zip | |
Stop using deprecated pang_ft2 functions
Fixed bugs:
- https://launchpad.net/bugs/166276
(bzr r12020)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 12 | ||||
| -rw-r--r-- | src/libnrtype/FontInstance.cpp | 7 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index ed1e1dc5c..98904a47a 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -315,9 +315,15 @@ font_factory::font_factory(void) : { #ifdef USE_PANGO_WIN32 #else - pango_ft2_font_map_set_resolution((PangoFT2FontMap*)fontServer, 72, 72); - fontContext = pango_ft2_font_map_create_context((PangoFT2FontMap*)fontServer); - pango_ft2_font_map_set_default_substitute((PangoFT2FontMap*)fontServer,FactorySubstituteFunc,this,NULL); + pango_ft2_font_map_set_resolution(PANGO_FT2_FONT_MAP(fontServer), + 72, 72); + + fontContext = pango_font_map_create_context(fontServer); + + pango_ft2_font_map_set_default_substitute(PANGO_FT2_FONT_MAP(fontServer), + FactorySubstituteFunc, + this, + NULL); #endif } diff --git a/src/libnrtype/FontInstance.cpp b/src/libnrtype/FontInstance.cpp index 4ca8bf2a0..f26b157da 100644 --- a/src/libnrtype/FontInstance.cpp +++ b/src/libnrtype/FontInstance.cpp @@ -399,7 +399,7 @@ void font_instance::InitTheFace() SetGraphicsMode(daddy->hScreenDC, GM_COMPATIBLE); SelectObject(daddy->hScreenDC,theFace); #else - theFace=pango_ft2_font_get_face(pFont); // Deprecated, use pango_fc_font_lock_face() instead + theFace=pango_fc_font_lock_face(PANGO_FC_FONT(pFont)); if ( theFace ) { FT_Select_Charmap(theFace,ft_encoding_unicode) && FT_Select_Charmap(theFace,ft_encoding_symbol); } @@ -411,6 +411,8 @@ void font_instance::FreeTheFace() #ifdef USE_PANGO_WIN32 SelectObject(daddy->hScreenDC,GetStockObject(SYSTEM_FONT)); pango_win32_font_cache_unload(daddy->pangoFontCache,theFace); +#else + pango_fc_font_unlock_face(PANGO_FC_FONT(pFont)); #endif theFace=NULL; } @@ -454,12 +456,13 @@ int font_instance::MapUnicodeChar(gunichar c) #ifdef USE_PANGO_WIN32 res = pango_win32_font_get_glyph_index(pFont, c); #else - theFace = pango_ft2_font_get_face(pFont); + theFace = pango_fc_font_lock_face(PANGO_FC_FONT(pFont)); if ( c > 0xf0000 ) { res = CLAMP(c, 0xf0000, 0x1fffff) - 0xf0000; } else { res = FT_Get_Char_Index(theFace, c); } + pango_fc_font_unlock_face(PANGO_FC_FONT(pFont)); #endif } return res; |
