pdf2json 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +9 -0
- data/bin/.gitkeep +0 -0
- data/ext/extconf.rb +30 -0
- data/lib/pdf2json.rb +8 -0
- data/pdf2json-0.52-source/AUTHORS +24 -0
- data/pdf2json-0.52-source/CHANGES +11 -0
- data/pdf2json-0.52-source/Makefile +84 -0
- data/pdf2json-0.52-source/Makefile.in +84 -0
- data/pdf2json-0.52-source/aclocal.m4 +274 -0
- data/pdf2json-0.52-source/aconf-win32.h +86 -0
- data/pdf2json-0.52-source/aconf.h +42 -0
- data/pdf2json-0.52-source/aconf.h.in +41 -0
- data/pdf2json-0.52-source/autom4te.cache/output.0 +6908 -0
- data/pdf2json-0.52-source/autom4te.cache/requests +76 -0
- data/pdf2json-0.52-source/autom4te.cache/traces.0 +466 -0
- data/pdf2json-0.52-source/config.log +1259 -0
- data/pdf2json-0.52-source/config.status +1050 -0
- data/pdf2json-0.52-source/configure +6908 -0
- data/pdf2json-0.52-source/configure.ac +93 -0
- data/pdf2json-0.52-source/doc/pdffonts.1 +130 -0
- data/pdf2json-0.52-source/doc/pdffonts.cat +107 -0
- data/pdf2json-0.52-source/doc/pdffonts.hlp +117 -0
- data/pdf2json-0.52-source/doc/pdfimages.1 +102 -0
- data/pdf2json-0.52-source/doc/pdfimages.cat +92 -0
- data/pdf2json-0.52-source/doc/pdfimages.hlp +101 -0
- data/pdf2json-0.52-source/doc/pdfinfo.1 +158 -0
- data/pdf2json-0.52-source/doc/pdfinfo.cat +119 -0
- data/pdf2json-0.52-source/doc/pdfinfo.hlp +129 -0
- data/pdf2json-0.52-source/doc/pdftoppm.1 +115 -0
- data/pdf2json-0.52-source/doc/pdftoppm.cat +105 -0
- data/pdf2json-0.52-source/doc/pdftoppm.hlp +114 -0
- data/pdf2json-0.52-source/doc/pdftops.1 +229 -0
- data/pdf2json-0.52-source/doc/pdftops.cat +221 -0
- data/pdf2json-0.52-source/doc/pdftops.hlp +231 -0
- data/pdf2json-0.52-source/doc/pdftotext.1 +137 -0
- data/pdf2json-0.52-source/doc/pdftotext.cat +120 -0
- data/pdf2json-0.52-source/doc/pdftotext.hlp +133 -0
- data/pdf2json-0.52-source/doc/sample-xpdfrc +91 -0
- data/pdf2json-0.52-source/doc/xpdf.1 +513 -0
- data/pdf2json-0.52-source/doc/xpdf.cat +476 -0
- data/pdf2json-0.52-source/doc/xpdf.hlp +489 -0
- data/pdf2json-0.52-source/doc/xpdfrc.5 +480 -0
- data/pdf2json-0.52-source/doc/xpdfrc.cat +474 -0
- data/pdf2json-0.52-source/doc/xpdfrc.hlp +479 -0
- data/pdf2json-0.52-source/fofi/.DS_Store +0 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.cc +156 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.h +57 -0
- data/pdf2json-0.52-source/fofi/FoFiBase.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.cc +994 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.h +36 -0
- data/pdf2json-0.52-source/fofi/FoFiEncodings.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.cc +2027 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.h +174 -0
- data/pdf2json-0.52-source/fofi/FoFiTrueType.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.cc +252 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.h +59 -0
- data/pdf2json-0.52-source/fofi/FoFiType1.o +0 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.cc +2603 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.h +233 -0
- data/pdf2json-0.52-source/fofi/FoFiType1C.o +0 -0
- data/pdf2json-0.52-source/fofi/Makefile +70 -0
- data/pdf2json-0.52-source/fofi/Makefile.dep +0 -0
- data/pdf2json-0.52-source/fofi/Makefile.in +70 -0
- data/pdf2json-0.52-source/fofi/libfofi.a +0 -0
- data/pdf2json-0.52-source/fofi/vms_make.com +0 -0
- data/pdf2json-0.52-source/freetype.win32/.DS_Store +0 -0
- data/pdf2json-0.52-source/freetype.win32/include/.DS_Store +0 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftconfig.h +528 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftheader.h +780 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftmodule.h +32 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftoption.h +733 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/config/ftstdlib.h +173 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/freetype.h +3919 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftadvanc.h +179 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbbox.h +94 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbdf.h +209 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftbitmap.h +227 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftcache.h +1128 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftchapters.h +103 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftcid.h +166 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fterrdef.h +244 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fterrors.h +206 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgasp.h +120 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftglyph.h +613 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgxval.h +358 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftgzip.h +102 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftimage.h +1313 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftincrem.h +353 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlcdfil.h +213 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlist.h +277 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftlzw.h +99 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmac.h +274 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmm.h +378 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmodapi.h +483 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftmoderr.h +155 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftotval.h +203 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftoutln.h +537 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftpfr.h +172 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftrender.h +230 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsizes.h +159 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsnames.h +200 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftstroke.h +716 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsynth.h +80 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftsystem.h +347 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fttrigon.h +350 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/fttypes.h +588 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftwinfnt.h +274 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ftxf86.h +83 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/autohint.h +231 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftcalc.h +179 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftdebug.h +250 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftdriver.h +422 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftgloadr.h +168 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftmemory.h +380 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftobjs.h +1428 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftpic.h +67 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftrfork.h +196 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftserv.h +620 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftstream.h +539 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/fttrace.h +139 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/ftvalid.h +150 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/internal.h +51 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/pcftypes.h +56 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/psaux.h +873 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/pshints.h +712 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svbdf.h +77 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svcid.h +83 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svgldict.h +82 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svgxval.h +72 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svkern.h +51 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svmm.h +104 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svotval.h +55 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpfr.h +66 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpostnm.h +79 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpscmap.h +164 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svpsinfo.h +92 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svsfnt.h +102 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svttcmap.h +106 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svtteng.h +53 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svttglyf.h +67 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svwinfnt.h +50 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/services/svxf86nm.h +55 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/sfnt.h +897 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/t1types.h +270 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/internal/tttypes.h +1543 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/t1tables.h +504 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ttnameid.h +1247 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/tttables.h +759 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/tttags.h +107 -0
- data/pdf2json-0.52-source/freetype.win32/include/freetype/ttunpat.h +59 -0
- data/pdf2json-0.52-source/freetype.win32/include/ft2build.h +39 -0
- data/pdf2json-0.52-source/freetype.win32/lib/freetype_a.lib +0 -0
- data/pdf2json-0.52-source/goo/.DS_Store +0 -0
- data/pdf2json-0.52-source/goo/FixedPoint.cc +118 -0
- data/pdf2json-0.52-source/goo/FixedPoint.h +155 -0
- data/pdf2json-0.52-source/goo/FixedPoint.o +0 -0
- data/pdf2json-0.52-source/goo/GHash.cc +380 -0
- data/pdf2json-0.52-source/goo/GHash.h +78 -0
- data/pdf2json-0.52-source/goo/GHash.o +0 -0
- data/pdf2json-0.52-source/goo/GList.cc +97 -0
- data/pdf2json-0.52-source/goo/GList.h +96 -0
- data/pdf2json-0.52-source/goo/GList.o +0 -0
- data/pdf2json-0.52-source/goo/GMutex.h +49 -0
- data/pdf2json-0.52-source/goo/GString.cc +724 -0
- data/pdf2json-0.52-source/goo/GString.cc.fixed +718 -0
- data/pdf2json-0.52-source/goo/GString.h +136 -0
- data/pdf2json-0.52-source/goo/GString.o +0 -0
- data/pdf2json-0.52-source/goo/ImgWriter.o +0 -0
- data/pdf2json-0.52-source/goo/JpegWriter.o +0 -0
- data/pdf2json-0.52-source/goo/Makefile +72 -0
- data/pdf2json-0.52-source/goo/Makefile.dep +0 -0
- data/pdf2json-0.52-source/goo/Makefile.in +72 -0
- data/pdf2json-0.52-source/goo/PNGWriter.o +0 -0
- data/pdf2json-0.52-source/goo/gfile.cc +731 -0
- data/pdf2json-0.52-source/goo/gfile.h +138 -0
- data/pdf2json-0.52-source/goo/gfile.o +0 -0
- data/pdf2json-0.52-source/goo/gmem.cc +264 -0
- data/pdf2json-0.52-source/goo/gmem.h +79 -0
- data/pdf2json-0.52-source/goo/gmem.o +0 -0
- data/pdf2json-0.52-source/goo/gmempp.cc +32 -0
- data/pdf2json-0.52-source/goo/gmempp.o +0 -0
- data/pdf2json-0.52-source/goo/gtypes.h +29 -0
- data/pdf2json-0.52-source/goo/libGoo.a +0 -0
- data/pdf2json-0.52-source/goo/parseargs.c +190 -0
- data/pdf2json-0.52-source/goo/parseargs.h +71 -0
- data/pdf2json-0.52-source/goo/parseargs.o +0 -0
- data/pdf2json-0.52-source/goo/vms_directory.c +214 -0
- data/pdf2json-0.52-source/goo/vms_dirent.h +67 -0
- data/pdf2json-0.52-source/goo/vms_make.com +82 -0
- data/pdf2json-0.52-source/goo/vms_sys_dirent.h +54 -0
- data/pdf2json-0.52-source/goo/vms_unix_time.h +102 -0
- data/pdf2json-0.52-source/goo/vms_unix_times.c +42 -0
- data/pdf2json-0.52-source/goo/vms_unlink.c +22 -0
- data/pdf2json-0.52-source/ms_make.bat +199 -0
- data/pdf2json-0.52-source/splash/.DS_Store +0 -0
- data/pdf2json-0.52-source/splash/Makefile +103 -0
- data/pdf2json-0.52-source/splash/Makefile.dep +0 -0
- data/pdf2json-0.52-source/splash/Makefile.in +103 -0
- data/pdf2json-0.52-source/splash/Splash.cc +3310 -0
- data/pdf2json-0.52-source/splash/Splash.h +293 -0
- data/pdf2json-0.52-source/splash/Splash.o +0 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.cc +188 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.h +64 -0
- data/pdf2json-0.52-source/splash/SplashBitmap.o +0 -0
- data/pdf2json-0.52-source/splash/SplashClip.cc +382 -0
- data/pdf2json-0.52-source/splash/SplashClip.h +107 -0
- data/pdf2json-0.52-source/splash/SplashClip.o +0 -0
- data/pdf2json-0.52-source/splash/SplashErrorCodes.h +32 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.cc +357 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.h +58 -0
- data/pdf2json-0.52-source/splash/SplashFTFont.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.cc +179 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.h +65 -0
- data/pdf2json-0.52-source/splash/SplashFTFontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.cc +114 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.h +73 -0
- data/pdf2json-0.52-source/splash/SplashFTFontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFont.cc +176 -0
- data/pdf2json-0.52-source/splash/SplashFont.h +104 -0
- data/pdf2json-0.52-source/splash/SplashFont.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.cc +317 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.h +91 -0
- data/pdf2json-0.52-source/splash/SplashFontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.cc +55 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.h +60 -0
- data/pdf2json-0.52-source/splash/SplashFontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.cc +23 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.h +30 -0
- data/pdf2json-0.52-source/splash/SplashFontFileID.o +0 -0
- data/pdf2json-0.52-source/splash/SplashGlyphBitmap.h +26 -0
- data/pdf2json-0.52-source/splash/SplashMath.h +89 -0
- data/pdf2json-0.52-source/splash/SplashPath.cc +184 -0
- data/pdf2json-0.52-source/splash/SplashPath.h +121 -0
- data/pdf2json-0.52-source/splash/SplashPath.o +0 -0
- data/pdf2json-0.52-source/splash/SplashPattern.cc +40 -0
- data/pdf2json-0.52-source/splash/SplashPattern.h +65 -0
- data/pdf2json-0.52-source/splash/SplashPattern.o +0 -0
- data/pdf2json-0.52-source/splash/SplashScreen.cc +383 -0
- data/pdf2json-0.52-source/splash/SplashScreen.h +56 -0
- data/pdf2json-0.52-source/splash/SplashScreen.o +0 -0
- data/pdf2json-0.52-source/splash/SplashState.cc +165 -0
- data/pdf2json-0.52-source/splash/SplashState.h +103 -0
- data/pdf2json-0.52-source/splash/SplashState.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.cc +287 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.h +57 -0
- data/pdf2json-0.52-source/splash/SplashT1Font.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.cc +124 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.h +53 -0
- data/pdf2json-0.52-source/splash/SplashT1FontEngine.o +0 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.cc +97 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.h +58 -0
- data/pdf2json-0.52-source/splash/SplashT1FontFile.o +0 -0
- data/pdf2json-0.52-source/splash/SplashTypes.h +132 -0
- data/pdf2json-0.52-source/splash/SplashXPath.cc +438 -0
- data/pdf2json-0.52-source/splash/SplashXPath.h +100 -0
- data/pdf2json-0.52-source/splash/SplashXPath.o +0 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.cc +428 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.h +87 -0
- data/pdf2json-0.52-source/splash/SplashXPathScanner.o +0 -0
- data/pdf2json-0.52-source/splash/libsplash.a +0 -0
- data/pdf2json-0.52-source/splash/vms_make.com +0 -0
- data/pdf2json-0.52-source/src/.DS_Store +0 -0
- data/pdf2json-0.52-source/src/GVector.h +101 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.cc +1243 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.h +307 -0
- data/pdf2json-0.52-source/src/ImgOutputDev.o +0 -0
- data/pdf2json-0.52-source/src/Makefile +68 -0
- data/pdf2json-0.52-source/src/Makefile.in +68 -0
- data/pdf2json-0.52-source/src/XmlFonts.cc +367 -0
- data/pdf2json-0.52-source/src/XmlFonts.h +91 -0
- data/pdf2json-0.52-source/src/XmlFonts.o +0 -0
- data/pdf2json-0.52-source/src/XmlLinks.cc +101 -0
- data/pdf2json-0.52-source/src/XmlLinks.h +54 -0
- data/pdf2json-0.52-source/src/XmlLinks.o +0 -0
- data/pdf2json-0.52-source/src/pdf2json +0 -0
- data/pdf2json-0.52-source/src/pdf2json.cc +343 -0
- data/pdf2json-0.52-source/src/pdf2json.o +0 -0
- data/pdf2json-0.52-source/src/pdf2xml.dtd +22 -0
- data/pdf2json-0.52-source/src/pdf2xmljson.dtd +9 -0
- data/pdf2json-0.52-source/xpdf/.DS_Store +0 -0
- data/pdf2json-0.52-source/xpdf/Annot.cc +1556 -0
- data/pdf2json-0.52-source/xpdf/Annot.h +142 -0
- data/pdf2json-0.52-source/xpdf/Annot.o +0 -0
- data/pdf2json-0.52-source/xpdf/Array.cc +73 -0
- data/pdf2json-0.52-source/xpdf/Array.h +58 -0
- data/pdf2json-0.52-source/xpdf/Array.o +0 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.cc +65 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.h +57 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFont.o +0 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.cc +4284 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.h +23 -0
- data/pdf2json-0.52-source/xpdf/BuiltinFontTables.o +0 -0
- data/pdf2json-0.52-source/xpdf/CMap.cc +408 -0
- data/pdf2json-0.52-source/xpdf/CMap.h +102 -0
- data/pdf2json-0.52-source/xpdf/CMap.o +0 -0
- data/pdf2json-0.52-source/xpdf/Catalog.cc +374 -0
- data/pdf2json-0.52-source/xpdf/Catalog.h +97 -0
- data/pdf2json-0.52-source/xpdf/Catalog.o +0 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.cc +540 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.h +117 -0
- data/pdf2json-0.52-source/xpdf/CharCodeToUnicode.o +0 -0
- data/pdf2json-0.52-source/xpdf/CharTypes.h +24 -0
- data/pdf2json-0.52-source/xpdf/CompactFontTables.h +464 -0
- data/pdf2json-0.52-source/xpdf/CoreOutputDev.cc +61 -0
- data/pdf2json-0.52-source/xpdf/CoreOutputDev.h +61 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.cc +776 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.h +95 -0
- data/pdf2json-0.52-source/xpdf/Decrypt.o +0 -0
- data/pdf2json-0.52-source/xpdf/Dict.cc +95 -0
- data/pdf2json-0.52-source/xpdf/Dict.h +77 -0
- data/pdf2json-0.52-source/xpdf/Dict.o +0 -0
- data/pdf2json-0.52-source/xpdf/Error.cc +38 -0
- data/pdf2json-0.52-source/xpdf/Error.h +23 -0
- data/pdf2json-0.52-source/xpdf/Error.o +0 -0
- data/pdf2json-0.52-source/xpdf/ErrorCodes.h +36 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.cc +1824 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.h +20 -0
- data/pdf2json-0.52-source/xpdf/FontEncodingTables.o +0 -0
- data/pdf2json-0.52-source/xpdf/Function.cc +1573 -0
- data/pdf2json-0.52-source/xpdf/Function.h +229 -0
- data/pdf2json-0.52-source/xpdf/Function.o +0 -0
- data/pdf2json-0.52-source/xpdf/Gfx.cc +4187 -0
- data/pdf2json-0.52-source/xpdf/Gfx.h +312 -0
- data/pdf2json-0.52-source/xpdf/Gfx.o +0 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.cc +1568 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.h +320 -0
- data/pdf2json-0.52-source/xpdf/GfxFont.o +0 -0
- data/pdf2json-0.52-source/xpdf/GfxState.cc +4137 -0
- data/pdf2json-0.52-source/xpdf/GfxState.h +1244 -0
- data/pdf2json-0.52-source/xpdf/GfxState.o +0 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.cc +2924 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.cc.old +2908 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.h +466 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.h.old +463 -0
- data/pdf2json-0.52-source/xpdf/GlobalParams.o +0 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.cc +195 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.h +76 -0
- data/pdf2json-0.52-source/xpdf/ImageOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.cc +322 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.h +109 -0
- data/pdf2json-0.52-source/xpdf/JArithmeticDecoder.o +0 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.cc +3413 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.h +145 -0
- data/pdf2json-0.52-source/xpdf/JBIG2Stream.o +0 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.cc +3144 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.h +351 -0
- data/pdf2json-0.52-source/xpdf/JPXStream.o +0 -0
- data/pdf2json-0.52-source/xpdf/Lexer.cc +485 -0
- data/pdf2json-0.52-source/xpdf/Lexer.h +80 -0
- data/pdf2json-0.52-source/xpdf/Lexer.o +0 -0
- data/pdf2json-0.52-source/xpdf/Link.cc +806 -0
- data/pdf2json-0.52-source/xpdf/Link.cc.old +784 -0
- data/pdf2json-0.52-source/xpdf/Link.h +415 -0
- data/pdf2json-0.52-source/xpdf/Link.h.old +369 -0
- data/pdf2json-0.52-source/xpdf/Link.o +0 -0
- data/pdf2json-0.52-source/xpdf/Makefile +232 -0
- data/pdf2json-0.52-source/xpdf/Makefile.dep +0 -0
- data/pdf2json-0.52-source/xpdf/Makefile.in +232 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.cc +116 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.h +42 -0
- data/pdf2json-0.52-source/xpdf/NameToCharCode.o +0 -0
- data/pdf2json-0.52-source/xpdf/NameToUnicodeTable.h +1097 -0
- data/pdf2json-0.52-source/xpdf/Object.cc +231 -0
- data/pdf2json-0.52-source/xpdf/Object.h +303 -0
- data/pdf2json-0.52-source/xpdf/Object.o +0 -0
- data/pdf2json-0.52-source/xpdf/Outline.cc +151 -0
- data/pdf2json-0.52-source/xpdf/Outline.h +76 -0
- data/pdf2json-0.52-source/xpdf/Outline.o +0 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.cc +131 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.h +253 -0
- data/pdf2json-0.52-source/xpdf/OutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/PDFCore.cc +2044 -0
- data/pdf2json-0.52-source/xpdf/PDFCore.h +321 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.cc +404 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.h +183 -0
- data/pdf2json-0.52-source/xpdf/PDFDoc.o +0 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.cc +44 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.h +16 -0
- data/pdf2json-0.52-source/xpdf/PDFDocEncoding.o +0 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.cc +6224 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.h +395 -0
- data/pdf2json-0.52-source/xpdf/PSOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.cc +135 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.h +41 -0
- data/pdf2json-0.52-source/xpdf/PSTokenizer.o +0 -0
- data/pdf2json-0.52-source/xpdf/Page.cc +454 -0
- data/pdf2json-0.52-source/xpdf/Page.h +187 -0
- data/pdf2json-0.52-source/xpdf/Page.o +0 -0
- data/pdf2json-0.52-source/xpdf/Parser.cc +227 -0
- data/pdf2json-0.52-source/xpdf/Parser.h +59 -0
- data/pdf2json-0.52-source/xpdf/Parser.o +0 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.cc +257 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.h +130 -0
- data/pdf2json-0.52-source/xpdf/PreScanOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.cc +390 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.h +160 -0
- data/pdf2json-0.52-source/xpdf/SecurityHandler.o +0 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.cc +2845 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.h +247 -0
- data/pdf2json-0.52-source/xpdf/SplashOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/Stream-CCITT.h +459 -0
- data/pdf2json-0.52-source/xpdf/Stream.cc +4627 -0
- data/pdf2json-0.52-source/xpdf/Stream.h +858 -0
- data/pdf2json-0.52-source/xpdf/Stream.o +0 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.cc +4090 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.h +661 -0
- data/pdf2json-0.52-source/xpdf/TextOutputDev.o +0 -0
- data/pdf2json-0.52-source/xpdf/UTF8.h +56 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.cc +302 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.cc.old +293 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.h +135 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.h.old +123 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMap.o +0 -0
- data/pdf2json-0.52-source/xpdf/UnicodeMapTables.h +361 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.cc +949 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.h +20 -0
- data/pdf2json-0.52-source/xpdf/UnicodeTypeTable.o +0 -0
- data/pdf2json-0.52-source/xpdf/XPDFApp.cc +447 -0
- data/pdf2json-0.52-source/xpdf/XPDFApp.h +114 -0
- data/pdf2json-0.52-source/xpdf/XPDFCore.cc +1655 -0
- data/pdf2json-0.52-source/xpdf/XPDFCore.h +251 -0
- data/pdf2json-0.52-source/xpdf/XPDFTree.cc +931 -0
- data/pdf2json-0.52-source/xpdf/XPDFTree.h +45 -0
- data/pdf2json-0.52-source/xpdf/XPDFTreeP.h +87 -0
- data/pdf2json-0.52-source/xpdf/XPDFViewer.cc +3488 -0
- data/pdf2json-0.52-source/xpdf/XPDFViewer.h +352 -0
- data/pdf2json-0.52-source/xpdf/XRef.cc +896 -0
- data/pdf2json-0.52-source/xpdf/XRef.h +133 -0
- data/pdf2json-0.52-source/xpdf/XRef.o +0 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.cc +262 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.h +341 -0
- data/pdf2json-0.52-source/xpdf/XpdfPluginAPI.o +0 -0
- data/pdf2json-0.52-source/xpdf/about-text.h +48 -0
- data/pdf2json-0.52-source/xpdf/about.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/backArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/backArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/config.h +112 -0
- data/pdf2json-0.52-source/xpdf/dblLeftArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblLeftArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblRightArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/dblRightArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/find.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/findDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/forwardArrow.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/forwardArrowDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/leftArrow.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/leftArrowDis.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/libXpdf.a +0 -0
- data/pdf2json-0.52-source/xpdf/pdffonts +0 -0
- data/pdf2json-0.52-source/xpdf/pdffonts.cc +298 -0
- data/pdf2json-0.52-source/xpdf/pdffonts.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdfimages +0 -0
- data/pdf2json-0.52-source/xpdf/pdfimages.cc +155 -0
- data/pdf2json-0.52-source/xpdf/pdfimages.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo +0 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo.cc +387 -0
- data/pdf2json-0.52-source/xpdf/pdfinfo.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdftoppm.cc +203 -0
- data/pdf2json-0.52-source/xpdf/pdftops +0 -0
- data/pdf2json-0.52-source/xpdf/pdftops.cc +344 -0
- data/pdf2json-0.52-source/xpdf/pdftops.o +0 -0
- data/pdf2json-0.52-source/xpdf/pdftotext +0 -0
- data/pdf2json-0.52-source/xpdf/pdftotext.cc +333 -0
- data/pdf2json-0.52-source/xpdf/pdftotext.o +0 -0
- data/pdf2json-0.52-source/xpdf/print.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/printDis.xbm +6 -0
- data/pdf2json-0.52-source/xpdf/rightArrow.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/rightArrowDis.xbm +5 -0
- data/pdf2json-0.52-source/xpdf/vms_make.com +129 -0
- data/pdf2json-0.52-source/xpdf/xpdf.cc +344 -0
- data/pdf2json-0.52-source/xpdf/xpdfIcon.xpm +62 -0
- data/pdf2json.gemspec +29 -0
- metadata +518 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// FoFiTrueType.h
|
4
|
+
//
|
5
|
+
// Copyright 1999-2003 Glyph & Cog, LLC
|
6
|
+
//
|
7
|
+
//========================================================================
|
8
|
+
|
9
|
+
#ifndef FOFITRUETYPE_H
|
10
|
+
#define FOFITRUETYPE_H
|
11
|
+
|
12
|
+
#include <aconf.h>
|
13
|
+
|
14
|
+
#ifdef USE_GCC_PRAGMAS
|
15
|
+
#pragma interface
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#include "gtypes.h"
|
19
|
+
#include "FoFiBase.h"
|
20
|
+
|
21
|
+
class GString;
|
22
|
+
class GHash;
|
23
|
+
struct TrueTypeTable;
|
24
|
+
struct TrueTypeCmap;
|
25
|
+
|
26
|
+
//------------------------------------------------------------------------
|
27
|
+
// FoFiTrueType
|
28
|
+
//------------------------------------------------------------------------
|
29
|
+
|
30
|
+
class FoFiTrueType: public FoFiBase {
|
31
|
+
public:
|
32
|
+
|
33
|
+
// Create a FoFiTrueType object from a memory buffer.
|
34
|
+
static FoFiTrueType *make(char *fileA, int lenA);
|
35
|
+
|
36
|
+
// Create a FoFiTrueType object from a file on disk.
|
37
|
+
static FoFiTrueType *load(char *fileName);
|
38
|
+
|
39
|
+
virtual ~FoFiTrueType();
|
40
|
+
|
41
|
+
// Returns true if this an OpenType font containing CFF data, false
|
42
|
+
// if it's a TrueType font (or OpenType font with TrueType data).
|
43
|
+
GBool isOpenTypeCFF() { return openTypeCFF; }
|
44
|
+
|
45
|
+
// Return the number of cmaps defined by this font.
|
46
|
+
int getNumCmaps();
|
47
|
+
|
48
|
+
// Return the platform ID of the <i>th cmap.
|
49
|
+
int getCmapPlatform(int i);
|
50
|
+
|
51
|
+
// Return the encoding ID of the <i>th cmap.
|
52
|
+
int getCmapEncoding(int i);
|
53
|
+
|
54
|
+
// Return the index of the cmap for <platform>, <encoding>. Returns
|
55
|
+
// -1 if there is no corresponding cmap.
|
56
|
+
int findCmap(int platform, int encoding);
|
57
|
+
|
58
|
+
// Return the GID corresponding to <c> according to the <i>th cmap.
|
59
|
+
Gushort mapCodeToGID(int i, int c);
|
60
|
+
|
61
|
+
// Returns the GID corresponding to <name> according to the post
|
62
|
+
// table. Returns 0 if there is no mapping for <name> or if the
|
63
|
+
// font does not have a post table.
|
64
|
+
int mapNameToGID(char *name);
|
65
|
+
|
66
|
+
// Return the mapping from CIDs to GIDs, and return the number of
|
67
|
+
// CIDs in *<nCIDs>. This is only useful for CID fonts. (Only
|
68
|
+
// useful for OpenType CFF fonts.)
|
69
|
+
Gushort *getCIDToGIDMap(int *nCIDs);
|
70
|
+
|
71
|
+
// Returns the least restrictive embedding licensing right (as
|
72
|
+
// defined by the TrueType spec):
|
73
|
+
// * 4: OS/2 table is missing or invalid
|
74
|
+
// * 3: installable embedding
|
75
|
+
// * 2: editable embedding
|
76
|
+
// * 1: preview & print embedding
|
77
|
+
// * 0: restricted license embedding
|
78
|
+
int getEmbeddingRights();
|
79
|
+
|
80
|
+
// Convert to a Type 42 font, suitable for embedding in a PostScript
|
81
|
+
// file. <psName> will be used as the PostScript font name (so we
|
82
|
+
// don't need to depend on the 'name' table in the font). The
|
83
|
+
// <encoding> array specifies the mapping from char codes to names.
|
84
|
+
// If <encoding> is NULL, the encoding is unknown or undefined. The
|
85
|
+
// <codeToGID> array specifies the mapping from char codes to GIDs.
|
86
|
+
// (Not useful for OpenType CFF fonts.)
|
87
|
+
void convertToType42(char *psName, char **encoding,
|
88
|
+
Gushort *codeToGID,
|
89
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
90
|
+
|
91
|
+
// Convert to a Type 1 font, suitable for embedding in a PostScript
|
92
|
+
// file. This is only useful with 8-bit fonts. If <newEncoding> is
|
93
|
+
// not NULL, it will be used in place of the encoding in the Type 1C
|
94
|
+
// font. If <ascii> is true the eexec section will be hex-encoded,
|
95
|
+
// otherwise it will be left as binary data. If <psName> is
|
96
|
+
// non-NULL, it will be used as the PostScript font name. (Only
|
97
|
+
// useful for OpenType CFF fonts.)
|
98
|
+
void convertToType1(char *psName, char **newEncoding, GBool ascii,
|
99
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
100
|
+
|
101
|
+
// Convert to a Type 2 CIDFont, suitable for embedding in a
|
102
|
+
// PostScript file. <psName> will be used as the PostScript font
|
103
|
+
// name (so we don't need to depend on the 'name' table in the
|
104
|
+
// font). The <cidMap> array maps CIDs to GIDs; it has <nCIDs>
|
105
|
+
// entries. (Not useful for OpenType CFF fonts.)
|
106
|
+
void convertToCIDType2(char *psName, Gushort *cidMap, int nCIDs,
|
107
|
+
GBool needVerticalMetrics,
|
108
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
109
|
+
|
110
|
+
// Convert to a Type 0 CIDFont, suitable for embedding in a
|
111
|
+
// PostScript file. <psName> will be used as the PostScript font
|
112
|
+
// name. (Only useful for OpenType CFF fonts.)
|
113
|
+
void convertToCIDType0(char *psName,
|
114
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
115
|
+
|
116
|
+
// Convert to a Type 0 (but non-CID) composite font, suitable for
|
117
|
+
// embedding in a PostScript file. <psName> will be used as the
|
118
|
+
// PostScript font name (so we don't need to depend on the 'name'
|
119
|
+
// table in the font). The <cidMap> array maps CIDs to GIDs; it has
|
120
|
+
// <nCIDs> entries. (Not useful for OpenType CFF fonts.)
|
121
|
+
void convertToType0(char *psName, Gushort *cidMap, int nCIDs,
|
122
|
+
GBool needVerticalMetrics,
|
123
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
124
|
+
|
125
|
+
// Convert to a Type 0 (but non-CID) composite font, suitable for
|
126
|
+
// embedding in a PostScript file. <psName> will be used as the
|
127
|
+
// PostScript font name. (Only useful for OpenType CFF fonts.)
|
128
|
+
void convertToType0(char *psName,
|
129
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
130
|
+
|
131
|
+
// Write a clean TTF file, filling in missing tables and correcting
|
132
|
+
// various other errors. If <name> is non-NULL, the font is renamed
|
133
|
+
// to <name>. If <codeToGID> is non-NULL, the font is re-encoded,
|
134
|
+
// using a Windows Unicode cmap. If <name> is NULL and the font is
|
135
|
+
// complete and correct, it will be written unmodified. (Not useful
|
136
|
+
// for OpenType CFF fonts.)
|
137
|
+
void writeTTF(FoFiOutputFunc outputFunc, void *outputStream,
|
138
|
+
char *name = NULL, Gushort *codeToGID = NULL);
|
139
|
+
|
140
|
+
private:
|
141
|
+
|
142
|
+
FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA);
|
143
|
+
void cvtEncoding(char **encoding,
|
144
|
+
FoFiOutputFunc outputFunc,
|
145
|
+
void *outputStream);
|
146
|
+
void cvtCharStrings(char **encoding,
|
147
|
+
Gushort *codeToGID,
|
148
|
+
FoFiOutputFunc outputFunc,
|
149
|
+
void *outputStream);
|
150
|
+
void cvtSfnts(FoFiOutputFunc outputFunc,
|
151
|
+
void *outputStream, GString *name,
|
152
|
+
GBool needVerticalMetrics);
|
153
|
+
void dumpString(Guchar *s, int length,
|
154
|
+
FoFiOutputFunc outputFunc,
|
155
|
+
void *outputStream);
|
156
|
+
Guint computeTableChecksum(Guchar *data, int length);
|
157
|
+
void parse();
|
158
|
+
void readPostTable();
|
159
|
+
int seekTable(char *tag);
|
160
|
+
|
161
|
+
TrueTypeTable *tables;
|
162
|
+
int nTables;
|
163
|
+
TrueTypeCmap *cmaps;
|
164
|
+
int nCmaps;
|
165
|
+
int nGlyphs;
|
166
|
+
int locaFmt;
|
167
|
+
int bbox[4];
|
168
|
+
GHash *nameToGID;
|
169
|
+
GBool openTypeCFF;
|
170
|
+
|
171
|
+
GBool parsedOk;
|
172
|
+
};
|
173
|
+
|
174
|
+
#endif
|
Binary file
|
@@ -0,0 +1,252 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// FoFiType1.cc
|
4
|
+
//
|
5
|
+
// Copyright 1999-2003 Glyph & Cog, LLC
|
6
|
+
//
|
7
|
+
//========================================================================
|
8
|
+
|
9
|
+
#include <aconf.h>
|
10
|
+
|
11
|
+
#ifdef USE_GCC_PRAGMAS
|
12
|
+
#pragma implementation
|
13
|
+
#endif
|
14
|
+
|
15
|
+
#include <stdlib.h>
|
16
|
+
#include <string.h>
|
17
|
+
#include "gmem.h"
|
18
|
+
#include "FoFiEncodings.h"
|
19
|
+
#include "FoFiType1.h"
|
20
|
+
|
21
|
+
//------------------------------------------------------------------------
|
22
|
+
// FoFiType1
|
23
|
+
//------------------------------------------------------------------------
|
24
|
+
|
25
|
+
FoFiType1 *FoFiType1::make(char *fileA, int lenA) {
|
26
|
+
return new FoFiType1(fileA, lenA, gFalse);
|
27
|
+
}
|
28
|
+
|
29
|
+
FoFiType1 *FoFiType1::load(char *fileName) {
|
30
|
+
char *fileA;
|
31
|
+
int lenA;
|
32
|
+
|
33
|
+
if (!(fileA = FoFiBase::readFile(fileName, &lenA))) {
|
34
|
+
return NULL;
|
35
|
+
}
|
36
|
+
return new FoFiType1(fileA, lenA, gTrue);
|
37
|
+
}
|
38
|
+
|
39
|
+
FoFiType1::FoFiType1(char *fileA, int lenA, GBool freeFileDataA):
|
40
|
+
FoFiBase(fileA, lenA, freeFileDataA)
|
41
|
+
{
|
42
|
+
name = NULL;
|
43
|
+
encoding = NULL;
|
44
|
+
parsed = gFalse;
|
45
|
+
}
|
46
|
+
|
47
|
+
FoFiType1::~FoFiType1() {
|
48
|
+
int i;
|
49
|
+
|
50
|
+
if (name) {
|
51
|
+
gfree(name);
|
52
|
+
}
|
53
|
+
if (encoding && encoding != fofiType1StandardEncoding) {
|
54
|
+
for (i = 0; i < 256; ++i) {
|
55
|
+
gfree(encoding[i]);
|
56
|
+
}
|
57
|
+
gfree(encoding);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
char *FoFiType1::getName() {
|
62
|
+
if (!parsed) {
|
63
|
+
parse();
|
64
|
+
}
|
65
|
+
return name;
|
66
|
+
}
|
67
|
+
|
68
|
+
char **FoFiType1::getEncoding() {
|
69
|
+
if (!parsed) {
|
70
|
+
parse();
|
71
|
+
}
|
72
|
+
return encoding;
|
73
|
+
}
|
74
|
+
|
75
|
+
void FoFiType1::writeEncoded(char **newEncoding,
|
76
|
+
FoFiOutputFunc outputFunc, void *outputStream) {
|
77
|
+
char buf[512];
|
78
|
+
char *line, *line2, *p;
|
79
|
+
int i;
|
80
|
+
|
81
|
+
// copy everything up to the encoding
|
82
|
+
for (line = (char *)file;
|
83
|
+
line && strncmp(line, "/Encoding", 9);
|
84
|
+
line = getNextLine(line)) ;
|
85
|
+
if (!line) {
|
86
|
+
// no encoding - just copy the whole font file
|
87
|
+
(*outputFunc)(outputStream, (char *)file, len);
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
(*outputFunc)(outputStream, (char *)file, line - (char *)file);
|
91
|
+
|
92
|
+
// write the new encoding
|
93
|
+
(*outputFunc)(outputStream, "/Encoding 256 array\n", 20);
|
94
|
+
(*outputFunc)(outputStream,
|
95
|
+
"0 1 255 {1 index exch /.notdef put} for\n", 40);
|
96
|
+
for (i = 0; i < 256; ++i) {
|
97
|
+
if (newEncoding[i]) {
|
98
|
+
sprintf(buf, "dup %d /%s put\n", i, newEncoding[i]);
|
99
|
+
(*outputFunc)(outputStream, buf, strlen(buf));
|
100
|
+
}
|
101
|
+
}
|
102
|
+
(*outputFunc)(outputStream, "readonly def\n", 13);
|
103
|
+
|
104
|
+
// find the end of the encoding data
|
105
|
+
//~ this ought to parse PostScript tokens
|
106
|
+
if (!strncmp(line, "/Encoding StandardEncoding def", 30)) {
|
107
|
+
line = getNextLine(line);
|
108
|
+
} else {
|
109
|
+
// skip "/Encoding" + one whitespace char,
|
110
|
+
// then look for 'def' preceded by PostScript whitespace
|
111
|
+
p = line + 10;
|
112
|
+
line = NULL;
|
113
|
+
for (; p < (char *)file + len; ++p) {
|
114
|
+
if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
|
115
|
+
*p == '\x0d' || *p == '\x0c' || *p == '\0') &&
|
116
|
+
p + 4 <= (char *)file + len &&
|
117
|
+
!strncmp(p + 1, "def", 3)) {
|
118
|
+
line = p + 4;
|
119
|
+
break;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
// some fonts have two /Encoding entries in their dictionary, so we
|
125
|
+
// check for a second one here
|
126
|
+
if (line) {
|
127
|
+
for (line2 = line, i = 0;
|
128
|
+
i < 20 && line2 && strncmp(line2, "/Encoding", 9);
|
129
|
+
line2 = getNextLine(line2), ++i) ;
|
130
|
+
if (i < 20 && line2) {
|
131
|
+
(*outputFunc)(outputStream, line, line2 - line);
|
132
|
+
if (!strncmp(line2, "/Encoding StandardEncoding def", 30)) {
|
133
|
+
line = getNextLine(line2);
|
134
|
+
} else {
|
135
|
+
// skip "/Encoding" + one whitespace char,
|
136
|
+
// then look for 'def' preceded by PostScript whitespace
|
137
|
+
p = line2 + 10;
|
138
|
+
line = NULL;
|
139
|
+
for (; p < (char *)file + len; ++p) {
|
140
|
+
if ((*p == ' ' || *p == '\t' || *p == '\x0a' ||
|
141
|
+
*p == '\x0d' || *p == '\x0c' || *p == '\0') &&
|
142
|
+
p + 4 <= (char *)file + len &&
|
143
|
+
!strncmp(p + 1, "def", 3)) {
|
144
|
+
line = p + 4;
|
145
|
+
break;
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
// copy everything after the encoding
|
152
|
+
if (line) {
|
153
|
+
(*outputFunc)(outputStream, line, ((char *)file + len) - line);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
char *FoFiType1::getNextLine(char *line) {
|
159
|
+
while (line < (char *)file + len && *line != '\x0a' && *line != '\x0d') {
|
160
|
+
++line;
|
161
|
+
}
|
162
|
+
if (line < (char *)file + len && *line == '\x0d') {
|
163
|
+
++line;
|
164
|
+
}
|
165
|
+
if (line < (char *)file + len && *line == '\x0a') {
|
166
|
+
++line;
|
167
|
+
}
|
168
|
+
if (line >= (char *)file + len) {
|
169
|
+
return NULL;
|
170
|
+
}
|
171
|
+
return line;
|
172
|
+
}
|
173
|
+
|
174
|
+
void FoFiType1::parse() {
|
175
|
+
char *line, *line1, *p, *p2;
|
176
|
+
char buf[256];
|
177
|
+
char c;
|
178
|
+
int n, code, i, j;
|
179
|
+
|
180
|
+
for (i = 1, line = (char *)file;
|
181
|
+
i <= 100 && line && (!name || !encoding);
|
182
|
+
++i) {
|
183
|
+
|
184
|
+
// get font name
|
185
|
+
if (!name && !strncmp(line, "/FontName", 9)) {
|
186
|
+
strncpy(buf, line, 255);
|
187
|
+
buf[255] = '\0';
|
188
|
+
if ((p = strchr(buf+9, '/')) &&
|
189
|
+
(p = strtok(p+1, " \t\n\r"))) {
|
190
|
+
name = copyString(p);
|
191
|
+
}
|
192
|
+
line = getNextLine(line);
|
193
|
+
|
194
|
+
// get encoding
|
195
|
+
} else if (!encoding &&
|
196
|
+
!strncmp(line, "/Encoding StandardEncoding def", 30)) {
|
197
|
+
encoding = fofiType1StandardEncoding;
|
198
|
+
} else if (!encoding &&
|
199
|
+
!strncmp(line, "/Encoding 256 array", 19)) {
|
200
|
+
encoding = (char **)gmallocn(256, sizeof(char *));
|
201
|
+
for (j = 0; j < 256; ++j) {
|
202
|
+
encoding[j] = NULL;
|
203
|
+
}
|
204
|
+
for (j = 0, line = getNextLine(line);
|
205
|
+
j < 300 && line && (line1 = getNextLine(line));
|
206
|
+
++j, line = line1) {
|
207
|
+
if ((n = line1 - line) > 255) {
|
208
|
+
n = 255;
|
209
|
+
}
|
210
|
+
strncpy(buf, line, n);
|
211
|
+
buf[n] = '\0';
|
212
|
+
for (p = buf; *p == ' ' || *p == '\t'; ++p) ;
|
213
|
+
if (!strncmp(p, "dup", 3)) {
|
214
|
+
for (p += 3; *p == ' ' || *p == '\t'; ++p) ;
|
215
|
+
for (p2 = p; *p2 >= '0' && *p2 <= '9'; ++p2) ;
|
216
|
+
if (*p2) {
|
217
|
+
c = *p2;
|
218
|
+
*p2 = '\0';
|
219
|
+
code = atoi(p);
|
220
|
+
*p2 = c;
|
221
|
+
if (code == 8 && *p2 == '#') {
|
222
|
+
code = 0;
|
223
|
+
for (++p2; *p2 >= '0' && *p2 <= '7'; ++p2) {
|
224
|
+
code = code * 8 + (*p2 - '0');
|
225
|
+
}
|
226
|
+
}
|
227
|
+
if (code < 256) {
|
228
|
+
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
|
229
|
+
if (*p == '/') {
|
230
|
+
++p;
|
231
|
+
for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
|
232
|
+
*p2 = '\0';
|
233
|
+
encoding[code] = copyString(p);
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
} else {
|
238
|
+
if (strtok(buf, " \t") &&
|
239
|
+
(p = strtok(NULL, " \t\n\r")) && !strcmp(p, "def")) {
|
240
|
+
break;
|
241
|
+
}
|
242
|
+
}
|
243
|
+
}
|
244
|
+
//~ check for getinterval/putinterval junk
|
245
|
+
|
246
|
+
} else {
|
247
|
+
line = getNextLine(line);
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
parsed = gTrue;
|
252
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
//========================================================================
|
2
|
+
//
|
3
|
+
// FoFiType1.h
|
4
|
+
//
|
5
|
+
// Copyright 1999-2003 Glyph & Cog, LLC
|
6
|
+
//
|
7
|
+
//========================================================================
|
8
|
+
|
9
|
+
#ifndef FOFITYPE1_H
|
10
|
+
#define FOFITYPE1_H
|
11
|
+
|
12
|
+
#include <aconf.h>
|
13
|
+
|
14
|
+
#ifdef USE_GCC_PRAGMAS
|
15
|
+
#pragma interface
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#include "gtypes.h"
|
19
|
+
#include "FoFiBase.h"
|
20
|
+
|
21
|
+
//------------------------------------------------------------------------
|
22
|
+
// FoFiType1
|
23
|
+
//------------------------------------------------------------------------
|
24
|
+
|
25
|
+
class FoFiType1: public FoFiBase {
|
26
|
+
public:
|
27
|
+
|
28
|
+
// Create a FoFiType1 object from a memory buffer.
|
29
|
+
static FoFiType1 *make(char *fileA, int lenA);
|
30
|
+
|
31
|
+
// Create a FoFiType1 object from a file on disk.
|
32
|
+
static FoFiType1 *load(char *fileName);
|
33
|
+
|
34
|
+
virtual ~FoFiType1();
|
35
|
+
|
36
|
+
// Return the font name.
|
37
|
+
char *getName();
|
38
|
+
|
39
|
+
// Return the encoding, as an array of 256 names (any of which may
|
40
|
+
// be NULL).
|
41
|
+
char **getEncoding();
|
42
|
+
|
43
|
+
// Write a version of the Type 1 font file with a new encoding.
|
44
|
+
void writeEncoded(char **newEncoding,
|
45
|
+
FoFiOutputFunc outputFunc, void *outputStream);
|
46
|
+
|
47
|
+
private:
|
48
|
+
|
49
|
+
FoFiType1(char *fileA, int lenA, GBool freeFileDataA);
|
50
|
+
|
51
|
+
char *getNextLine(char *line);
|
52
|
+
void parse();
|
53
|
+
|
54
|
+
char *name;
|
55
|
+
char **encoding;
|
56
|
+
GBool parsed;
|
57
|
+
};
|
58
|
+
|
59
|
+
#endif
|