[poppler] poppler/splash: SplashFTFontEngine.cc, 1.1.1.1,
1.2 SplashFTFontEngine.h, 1.1.1.1, 1.2
Albert Astals Cid
aacid at freedesktop.org
Thu Sep 15 15:09:52 PDT 2005
Update of /cvs/poppler/poppler/splash
In directory gabe:/tmp/cvs-serv13288/splash
Modified Files:
SplashFTFontEngine.cc SplashFTFontEngine.h
Log Message:
Merge the xpdf 3.01 change that uses runtime detection of freetype version
Index: SplashFTFontEngine.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashFTFontEngine.cc,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SplashFTFontEngine.cc 3 Mar 2005 19:45:59 -0000 1.1.1.1
+++ SplashFTFontEngine.cc 15 Sep 2005 22:09:50 -0000 1.2
@@ -41,8 +41,15 @@
//------------------------------------------------------------------------
SplashFTFontEngine::SplashFTFontEngine(GBool aaA, FT_Library libA) {
+ FT_Int major, minor, patch;
+
aa = aaA;
lib = libA;
+
+ // as of FT 2.1.8, CID fonts are indexed by CID instead of GID
+ FT_Library_Version(lib, &major, &minor, &patch);
+ useCIDs = major > 2 ||
+ (major == 2 && (minor > 1 || (minor == 1 && patch > 7)));
}
SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA) {
@@ -81,20 +88,16 @@
SplashFontFile *ret;
// check for a CFF font
-#if HAVE_FREETYPE_217_OR_OLDER
- if ((ff = FoFiType1C::load(fileName))) {
+ if (useCIDs) {
+ cidToGIDMap = NULL;
+ nCIDs = 0;
+ } else if ((ff = FoFiType1C::load(fileName))) {
cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
delete ff;
} else {
cidToGIDMap = NULL;
nCIDs = 0;
}
-#else
- // No need to check for CFF Font, freetype treats all CID fonts the same way
- cidToGIDMap = NULL;
- nCIDs = 0;
-#endif
-
ret = SplashFTFontFile::loadCIDFont(this, idA, fileName, deleteFile,
cidToGIDMap, nCIDs);
if (!ret) {
Index: SplashFTFontEngine.h
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashFTFontEngine.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- SplashFTFontEngine.h 3 Mar 2005 19:45:59 -0000 1.1.1.1
+++ SplashFTFontEngine.h 15 Sep 2005 22:09:50 -0000 1.2
@@ -48,6 +48,7 @@
GBool aa;
FT_Library lib;
+ GBool useCIDs;
friend class SplashFTFontFile;
friend class SplashFTFont;
More information about the poppler
mailing list