From 1d223fa1ec3724b291a7d46de7e38e32c03c5235 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 6 Sep 2013 15:10:34 +0200 Subject: Simplify FreeType version check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 00a81233d9c2ae6b3996b744982715137fd6a626, we can rely on the version of the runtime library. Change-Id: I9af4a524c893d125d185da50334622007f2e44ce Reviewed-on: https://gerrit.libreoffice.org/5843 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/generic/glyphs/gcach_ftyp.cxx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'vcl/generic') diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index b627a2817979..df56d1b03ef6 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -61,10 +61,6 @@ #endif #include "rtl/instance.hxx" -#ifdef ANDROID -#define FTVERSION (1000*FREETYPE_MAJOR + 100*FREETYPE_MINOR + FREETYPE_PATCH) -#endif - typedef const FT_Vector* FT_Vector_CPtr; #include @@ -468,6 +464,10 @@ FreetypeManager::FreetypeManager() { /*FT_Error rcFT =*/ FT_Init_FreeType( &aLibFT ); + FT_Int nMajor = 0, nMinor = 0, nPatch = 0; + FT_Library_Version(aLibFT, &nMajor, &nMinor, &nPatch); + nFTVERSION = nMajor * 1000 + nMinor * 100 + nPatch; + #ifdef ANDROID // For Android we use the bundled static libfreetype.a, and we // want to avoid accidentally finding the FT_* symbols in the @@ -475,24 +475,14 @@ FreetypeManager::FreetypeManager() // libskia.so, but is not a public API, and in fact does crash the // app if used). pFT_Face_GetCharVariantIndex = FT_Face_GetCharVariantIndex; - nFTVERSION = FTVERSION; #else #ifdef RTLD_DEFAULT // true if a good dlfcn.h header was included - // Get version of freetype library to enable workarounds. pFT_Face_GetCharVariantIndex = (FT_UInt(*)(FT_Face, FT_ULong, FT_ULong))(sal_IntPtr)dlsym( RTLD_DEFAULT, "FT_Face_GetCharVariantIndex" ); - FT_Int nMajor = 0, nMinor = 0, nPatch = 0; - FT_Library_Version(aLibFT, &nMajor, &nMinor, &nPatch); - nFTVERSION = nMajor * 1000 + nMinor * 100 + nPatch; - // disable FT_Face_GetCharVariantIndex for older versions // https://bugzilla.mozilla.org/show_bug.cgi?id=618406#c8 if( nFTVERSION < 2404 ) pFT_Face_GetCharVariantIndex = NULL; - -#else // RTLD_DEFAULT - // assume systems where dlsym is not possible use supplied library - nFTVERSION = FTVERSION; #endif #endif // TODO: remove when the priorities are selected by UI -- cgit