summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-09-06 15:10:34 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-09-06 19:12:28 +0000
commit1d223fa1ec3724b291a7d46de7e38e32c03c5235 (patch)
treeec58440114350d25a6ef613c04acca62bcff7464 /vcl
parent4cbc41bc4eaa822829e68c1ee11eafe834bb7da7 (diff)
Simplify FreeType version check
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx18
1 files changed, 4 insertions, 14 deletions
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 <vector>
@@ -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