diff --git a/src/hb-icu-le/FontTableCache.h b/src/hb-icu-le/FontTableCache.h index d41d7c7268407db4a1bb2862c175c682ff5ec0ad..f956f885c1b6e9530961c97e20505ee5cf14ca56 100644 --- a/src/hb-icu-le/FontTableCache.h +++ b/src/hb-icu-le/FontTableCache.h @@ -13,6 +13,9 @@ #include #include "layout/LETypes.h" +#include "letest.h" + +HB_BEGIN_VISIBILITY U_NAMESPACE_USE @@ -40,5 +43,6 @@ private: le_int32 fTableCacheSize; }; -#endif +HB_END_VISIBILITY +#endif diff --git a/src/hb-icu-le/PortableFontInstance.cpp b/src/hb-icu-le/PortableFontInstance.cpp index f4eb17168a1c399c4ce8aa4417aacffbe4923e9e..c38e2b1143d24e263f5c9d19078ebf545e62bbd9 100644 --- a/src/hb-icu-le/PortableFontInstance.cpp +++ b/src/hb-icu-le/PortableFontInstance.cpp @@ -24,45 +24,6 @@ #include -// -// Finds the high bit by binary searching -// through the bits in n. -// -le_int8 PortableFontInstance::highBit(le_int32 value) -{ - if (value <= 0) { - return -32; - } - - le_uint8 bit = 0; - - if (value >= 1 << 16) { - value >>= 16; - bit += 16; - } - - if (value >= 1 << 8) { - value >>= 8; - bit += 8; - } - - if (value >= 1 << 4) { - value >>= 4; - bit += 4; - } - - if (value >= 1 << 2) { - value >>= 2; - bit += 2; - } - - if (value >= 1 << 1) { - value >>= 1; - bit += 1; - } - - return bit; -} PortableFontInstance::PortableFontInstance(hb_face_t *face, float xScale, float yScale, LEErrorCode &status) : fFace(face), fXScale(xScale), fYScale(yScale), fUnitsPerEM(0), fAscent(0), fDescent(0), fLeading(0), diff --git a/src/hb-icu-le/PortableFontInstance.h b/src/hb-icu-le/PortableFontInstance.h index 4bfeb364ba8a8578dd37a9ff24ec308b0a770ed3..ff48311d58d70d3c09e80c5f0267b02647bf864a 100644 --- a/src/hb-icu-le/PortableFontInstance.h +++ b/src/hb-icu-le/PortableFontInstance.h @@ -21,11 +21,14 @@ #include "layout/LETypes.h" #include "layout/LEFontInstance.h" +#include "letest.h" #include "FontTableCache.h" #include "cmaps.h" +HB_BEGIN_VISIBILITY + class PortableFontInstance : public LEFontInstance, protected FontTableCache { private: @@ -51,8 +54,6 @@ private: le_uint16 fNumGlyphs; le_uint16 fNumLongHorMetrics; - static le_int8 highBit(le_int32 value); - void getMetrics(); CMAPMapper *findUnicodeMapper(); @@ -109,4 +110,6 @@ public: }; +HB_END_VISIBILITY + #endif diff --git a/src/hb-icu-le/cmaps.cpp b/src/hb-icu-le/cmaps.cpp index 87087aaa0d249a8ef41f3f5a88ea41164f920150..d03ee710f0fef3283465faa802f7794b8b67b032 100644 --- a/src/hb-icu-le/cmaps.cpp +++ b/src/hb-icu-le/cmaps.cpp @@ -18,7 +18,7 @@ // Finds the high bit by binary searching // through the bits in value. // -le_int8 highBit(le_uint32 value) +static inline le_int8 highBit(le_uint32 value) { le_uint8 bit = 0; diff --git a/src/hb-icu-le/cmaps.h b/src/hb-icu-le/cmaps.h index fcad788bb281a804c2cc88e2442395bb2cfe099a..cf73f3a222c39dcab0e26a6ce413179019a19415 100644 --- a/src/hb-icu-le/cmaps.h +++ b/src/hb-icu-le/cmaps.h @@ -13,6 +13,8 @@ #include "letest.h" #include "sfnt.h" +HB_BEGIN_VISIBILITY + class CMAPMapper { public: @@ -80,5 +82,6 @@ inline CMAPMapper::~CMAPMapper() { } -#endif +HB_END_VISIBILITY +#endif diff --git a/src/hb-icu-le/letest.h b/src/hb-icu-le/letest.h index f924ca862b4ab3d505e9f8edbd35dd703a52bd27..ff564ba6b5c00a8c9ddb3121a6cff2f4014bef76 100644 --- a/src/hb-icu-le/letest.h +++ b/src/hb-icu-le/letest.h @@ -14,12 +14,24 @@ #ifndef __LETEST_H #define __LETEST_H + +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define HB_BEGIN_VISIBILITY _Pragma ("GCC visibility push(hidden)") +# define HB_END_VISIBILITY _Pragma ("GCC visibility pop") +#else +# define HB_BEGIN_VISIBILITY +# define HB_END_VISIBILITY +#endif + + #include "layout/LETypes.h" /*#include "unicode/ctest.h"*/ #include #include +HB_BEGIN_VISIBILITY + U_NAMESPACE_USE #define ARRAY_SIZE(array) (sizeof array / sizeof array[0]) @@ -46,4 +58,6 @@ typedef struct TestResult TestResult; //U_CFUNC void addCTests(TestNode **root); +HB_END_VISIBILITY + #endif diff --git a/src/hb-icu-le/sfnt.h b/src/hb-icu-le/sfnt.h index 4a8f2f39877937430082e789af1f1c93ca435e28..feec0ade3448dca54bf2d48fb941469e84ad8e0f 100644 --- a/src/hb-icu-le/sfnt.h +++ b/src/hb-icu-le/sfnt.h @@ -9,6 +9,9 @@ #define __SFNT_H #include "layout/LETypes.h" +#include "letest.h" + +HB_BEGIN_VISIBILITY U_NAMESPACE_USE @@ -445,5 +448,6 @@ struct NAMETable typedef struct NAMETable NAMETable; #endif -#endif +HB_END_VISIBILITY +#endif