node-poppler 5.1.4 → 6.0.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.
Files changed (176) hide show
  1. package/README.md +2 -0
  2. package/package.json +13 -13
  3. package/src/index.js +20 -8
  4. package/API.md +0 -465
  5. package/CHANGELOG.md +0 -976
  6. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Annot.h +0 -1783
  7. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/AnnotStampImageHelper.h +0 -68
  8. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Array.h +0 -92
  9. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/BBoxOutputDev.h +0 -54
  10. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CMap.h +0 -128
  11. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CachedFile.h +0 -149
  12. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoFontEngine.h +0 -122
  13. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoOutputDev.h +0 -468
  14. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CairoRescaleBox.h +0 -60
  15. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Catalog.h +0 -318
  16. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CertificateInfo.h +0 -129
  17. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharCodeToUnicode.h +0 -143
  18. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CharTypes.h +0 -24
  19. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlCachedFile.h +0 -37
  20. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/CurlPDFDocBuilder.h +0 -32
  21. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/DateInfo.h +0 -44
  22. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Decrypt.h +0 -147
  23. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Dict.h +0 -126
  24. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Error.h +0 -59
  25. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ErrorCodes.h +0 -54
  26. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FDPDFDocBuilder.h +0 -36
  27. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FILECacheLoader.h +0 -34
  28. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FileSpec.h +0 -85
  29. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontEncodingTables.h +0 -20
  30. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/FontInfo.h +0 -109
  31. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Form.h +0 -734
  32. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Function.h +0 -251
  33. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Gfx.h +0 -373
  34. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxFont.h +0 -466
  35. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState.h +0 -1759
  36. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GfxState_helpers.h +0 -90
  37. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/GlobalParams.h +0 -221
  38. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Hints.h +0 -91
  39. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JArithmeticDecoder.h +0 -131
  40. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JBIG2Stream.h +0 -130
  41. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JPEG2000Stream.h +0 -54
  42. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/JSInfo.h +0 -65
  43. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Lexer.h +0 -113
  44. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Linearization.h +0 -43
  45. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Link.h +0 -566
  46. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/LocalPDFDocBuilder.h +0 -32
  47. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/MarkedContentOutputDev.h +0 -132
  48. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Movie.h +0 -123
  49. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToCharCode.h +0 -52
  50. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/NameToUnicodeTable.h +0 -4300
  51. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Object.h +0 -678
  52. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OptionalContent.h +0 -117
  53. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Outline.h +0 -122
  54. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/OutputDev.h +0 -379
  55. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDoc.h +0 -419
  56. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocBuilder.h +0 -47
  57. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocEncoding.h +0 -43
  58. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PDFDocFactory.h +0 -58
  59. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSOutputDev.h +0 -549
  60. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PSTokenizer.h +0 -47
  61. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Page.h +0 -273
  62. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PageTransition.h +0 -105
  63. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Parser.h +0 -76
  64. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PopplerCache.h +0 -65
  65. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/PreScanOutputDev.h +0 -148
  66. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ProfileData.h +0 -35
  67. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Rendition.h +0 -164
  68. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SecurityHandler.h +0 -131
  69. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Sound.h +0 -82
  70. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/SplashOutputDev.h +0 -413
  71. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream-CCITT.h +0 -334
  72. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/Stream.h +0 -1504
  73. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructElement.h +0 -406
  74. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/StructTreeRoot.h +0 -89
  75. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/TextOutputDev.h +0 -918
  76. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UTF.h +0 -112
  77. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCClassTables.h +0 -983
  78. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeCompTables.h +0 -328
  79. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeDecompTables.h +0 -7181
  80. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMap.h +0 -128
  81. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapFuncs.h +0 -35
  82. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeMapTables.h +0 -84
  83. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/UnicodeTypeTable.h +0 -49
  84. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/ViewerPreferences.h +0 -87
  85. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/XRef.h +0 -325
  86. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-destination.h +0 -69
  87. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-document.h +0 -135
  88. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-embedded-file.h +0 -55
  89. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font-private.h +0 -68
  90. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-font.h +0 -95
  91. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-global.h +0 -132
  92. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-image.h +0 -74
  93. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-renderer.h +0 -77
  94. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page-transition.h +0 -85
  95. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-page.h +0 -225
  96. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-rectangle.h +0 -66
  97. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-toc.h +0 -72
  98. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler-version.h +0 -39
  99. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/cpp/poppler_cpp_export.h +0 -42
  100. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiBase.h +0 -66
  101. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiEncodings.h +0 -43
  102. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiIdentifier.h +0 -52
  103. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiTrueType.h +0 -190
  104. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1.h +0 -70
  105. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/fofi/FoFiType1C.h +0 -263
  106. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-action.h +0 -454
  107. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-annot.h +0 -333
  108. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-attachment.h +0 -123
  109. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-date.h +0 -32
  110. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-document.h +0 -541
  111. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-enums.h +0 -191
  112. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-features.h +0 -88
  113. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-form-field.h +0 -254
  114. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-layer.h +0 -50
  115. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-macros.h +0 -42
  116. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-media.h +0 -80
  117. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-movie.h +0 -81
  118. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-page.h +0 -424
  119. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler-structure-element.h +0 -425
  120. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/glib/poppler.h +0 -259
  121. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooCheckedOps.h +0 -116
  122. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooLikely.h +0 -22
  123. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooString.h +0 -262
  124. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/GooTimer.h +0 -59
  125. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/ImgWriter.h +0 -39
  126. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/JpegWriter.h +0 -69
  127. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/PNGWriter.h +0 -68
  128. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/TiffWriter.h +0 -70
  129. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gdir.h +0 -96
  130. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gfile.h +0 -156
  131. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gmem.h +0 -201
  132. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/grandom.h +0 -21
  133. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/goo/gstrtod.h +0 -45
  134. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler-config.h +0 -155
  135. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/poppler_private_export.h +0 -42
  136. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/Splash.h +0 -336
  137. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashBitmap.h +0 -127
  138. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashClip.h +0 -131
  139. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashErrorCodes.h +0 -50
  140. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFont.h +0 -71
  141. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontEngine.h +0 -72
  142. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFTFontFile.h +0 -64
  143. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFont.h +0 -116
  144. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontEngine.h +0 -89
  145. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFile.h +0 -98
  146. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashFontFileID.h +0 -40
  147. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashGlyphBitmap.h +0 -23
  148. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashMath.h +0 -215
  149. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPath.h +0 -138
  150. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashPattern.h +0 -107
  151. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashScreen.h +0 -87
  152. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashState.h +0 -132
  153. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashTypes.h +0 -248
  154. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPath.h +0 -95
  155. package/src/lib/win32/poppler-22.04.0/Library/include/poppler/splash/SplashXPathScanner.h +0 -136
  156. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-cpp.pc +0 -12
  157. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler-glib.pc +0 -12
  158. package/src/lib/win32/poppler-22.04.0/Library/lib/pkgconfig/poppler.pc +0 -10
  159. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-cpp.lib +0 -0
  160. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler-glib.lib +0 -0
  161. package/src/lib/win32/poppler-22.04.0/Library/lib/poppler.lib +0 -0
  162. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfattach.1 +0 -60
  163. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfdetach.1 +0 -94
  164. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdffonts.1 +0 -128
  165. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfimages.1 +0 -265
  166. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfinfo.1 +0 -198
  167. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfseparate.1 +0 -60
  168. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftocairo.1 +0 -346
  169. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftohtml.1 +0 -118
  170. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftoppm.1 +0 -230
  171. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftops.1 +0 -267
  172. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdftotext.1 +0 -157
  173. package/src/lib/win32/poppler-22.04.0/Library/share/man/man1/pdfunite.1 +0 -43
  174. package/src/lib/win32/poppler-22.04.0/share/poppler/CMakeLists.txt +0 -309
  175. package/src/lib/win32/poppler-22.04.0/share/poppler/Makefile +0 -333
  176. package/tsconfig.json +0 -9
@@ -1,466 +0,0 @@
1
- //========================================================================
2
- //
3
- // GfxFont.h
4
- //
5
- // Copyright 1996-2003 Glyph & Cog, LLC
6
- //
7
- //========================================================================
8
-
9
- //========================================================================
10
- //
11
- // Modified under the Poppler project - http://poppler.freedesktop.org
12
- //
13
- // All changes made under the Poppler project to this file are licensed
14
- // under GPL version 2 or later
15
- //
16
- // Copyright (C) 2005, 2008, 2015, 2017-2022 Albert Astals Cid <aacid@kde.org>
17
- // Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
18
- // Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
19
- // Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
20
- // Copyright (C) 2007 Jeff Muizelaar <jeff@infidigm.net>
21
- // Copyright (C) 2007 Koji Otani <sho@bbr.jp>
22
- // Copyright (C) 2011 Axel Strübing <axel.struebing@freenet.de>
23
- // Copyright (C) 2011, 2012, 2014 Adrian Johnson <ajohnson@redneon.com>
24
- // Copyright (C) 2015, 2018 Jason Crain <jason@aquaticape.us>
25
- // Copyright (C) 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
26
- // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
27
- // Copyright (C) 2021, 2022 Oliver Sander <oliver.sander@tu-dresden.de>
28
- //
29
- // To see a description of the changes please see the Changelog file that
30
- // came with your tarball or type make ChangeLog if you are building from git
31
- //
32
- //========================================================================
33
-
34
- #ifndef GFXFONT_H
35
- #define GFXFONT_H
36
-
37
- #include <memory>
38
- #include <optional>
39
-
40
- #include "goo/GooString.h"
41
- #include "Object.h"
42
- #include "CharTypes.h"
43
- #include "poppler_private_export.h"
44
-
45
- class Dict;
46
- class CMap;
47
- class CharCodeToUnicode;
48
- class FoFiTrueType;
49
- class PSOutputDev;
50
- struct GfxFontCIDWidths;
51
- struct Base14FontMapEntry;
52
- class FNVHash;
53
-
54
- //------------------------------------------------------------------------
55
- // GfxFontType
56
- //------------------------------------------------------------------------
57
-
58
- enum GfxFontType
59
- {
60
- //----- Gfx8BitFont
61
- fontUnknownType,
62
- fontType1,
63
- fontType1C,
64
- fontType1COT,
65
- fontType3,
66
- fontTrueType,
67
- fontTrueTypeOT,
68
- //----- GfxCIDFont
69
- fontCIDType0,
70
- fontCIDType0C,
71
- fontCIDType0COT,
72
- fontCIDType2,
73
- fontCIDType2OT
74
- };
75
-
76
- //------------------------------------------------------------------------
77
- // GfxFontCIDWidths
78
- //------------------------------------------------------------------------
79
-
80
- struct GfxFontCIDWidthExcep
81
- {
82
- CID first; // this record applies to
83
- CID last; // CIDs <first>..<last>
84
- double width; // char width
85
- };
86
-
87
- struct GfxFontCIDWidthExcepV
88
- {
89
- CID first; // this record applies to
90
- CID last; // CIDs <first>..<last>
91
- double height; // char height
92
- double vx, vy; // origin position
93
- };
94
-
95
- struct GfxFontCIDWidths
96
- {
97
- double defWidth; // default char width
98
- double defHeight; // default char height
99
- double defVY; // default origin position
100
- GfxFontCIDWidthExcep *exceps; // exceptions
101
- int nExceps; // number of valid entries in exceps
102
- GfxFontCIDWidthExcepV * // exceptions for vertical font
103
- excepsV;
104
- int nExcepsV; // number of valid entries in excepsV
105
- };
106
-
107
- //------------------------------------------------------------------------
108
- // GfxFontLoc
109
- //------------------------------------------------------------------------
110
-
111
- enum GfxFontLocType
112
- {
113
- gfxFontLocEmbedded, // font embedded in PDF file
114
- gfxFontLocExternal, // external font file
115
- gfxFontLocResident // font resident in PS printer
116
- };
117
-
118
- class POPPLER_PRIVATE_EXPORT GfxFontLoc
119
- {
120
- public:
121
- GfxFontLoc();
122
- ~GfxFontLoc();
123
-
124
- GfxFontLoc(const GfxFontLoc &) = delete;
125
- GfxFontLoc(GfxFontLoc &&) noexcept;
126
- GfxFontLoc &operator=(const GfxFontLoc &) = delete;
127
- GfxFontLoc &operator=(GfxFontLoc &&other) noexcept;
128
-
129
- // Set the 'path' string from a GooString on the heap.
130
- // Ownership of the object is taken.
131
- void setPath(GooString *pathA);
132
- const GooString *pathAsGooString() const;
133
-
134
- GfxFontLocType locType;
135
- GfxFontType fontType;
136
- Ref embFontID; // embedded stream obj ID
137
- // (if locType == gfxFontLocEmbedded)
138
- std::string path; // font file path
139
- // (if locType == gfxFontLocExternal)
140
- // PS font name
141
- // (if locType == gfxFontLocResident)
142
- int fontNum; // for TrueType collections
143
- // (if locType == gfxFontLocExternal)
144
- int substIdx; // substitute font index
145
- // (if locType == gfxFontLocExternal,
146
- // and a Base-14 substitution was made)
147
- };
148
-
149
- //------------------------------------------------------------------------
150
- // GfxFont
151
- //------------------------------------------------------------------------
152
-
153
- #define fontFixedWidth (1 << 0)
154
- #define fontSerif (1 << 1)
155
- #define fontSymbolic (1 << 2)
156
- #define fontItalic (1 << 6)
157
- #define fontBold (1 << 18)
158
-
159
- class POPPLER_PRIVATE_EXPORT GfxFont
160
- {
161
- public:
162
- enum Stretch
163
- {
164
- StretchNotDefined,
165
- UltraCondensed,
166
- ExtraCondensed,
167
- Condensed,
168
- SemiCondensed,
169
- Normal,
170
- SemiExpanded,
171
- Expanded,
172
- ExtraExpanded,
173
- UltraExpanded
174
- };
175
-
176
- enum Weight
177
- {
178
- WeightNotDefined,
179
- W100,
180
- W200,
181
- W300,
182
- W400, // Normal
183
- W500,
184
- W600,
185
- W700, // Bold
186
- W800,
187
- W900
188
- };
189
-
190
- // Build a GfxFont object.
191
- static std::unique_ptr<GfxFont> makeFont(XRef *xref, const char *tagA, Ref idA, Dict *fontDict);
192
-
193
- GfxFont(const GfxFont &) = delete;
194
- GfxFont &operator=(const GfxFont &other) = delete;
195
- virtual ~GfxFont();
196
-
197
- bool isOk() const { return ok; }
198
-
199
- // Get font tag.
200
- const std::string &getTag() const { return tag; }
201
-
202
- // Get font dictionary ID.
203
- const Ref *getID() const { return &id; }
204
-
205
- // Does this font match the tag?
206
- bool matches(const char *tagA) const { return tag == tagA; }
207
-
208
- // Get font family name.
209
- GooString *getFamily() const { return family; }
210
-
211
- // Get font stretch.
212
- Stretch getStretch() const { return stretch; }
213
-
214
- // Get font weight.
215
- Weight getWeight() const { return weight; }
216
-
217
- // Get the original font name (ignornig any munging that might have
218
- // been done to map to a canonical Base-14 font name).
219
- const std::optional<std::string> &getName() const { return name; }
220
-
221
- bool isSubset() const;
222
-
223
- // Returns the original font name without the subset tag (if it has one)
224
- std::string getNameWithoutSubsetTag() const;
225
-
226
- // Get font type.
227
- GfxFontType getType() const { return type; }
228
- virtual bool isCIDFont() const { return false; }
229
-
230
- // Get embedded font ID, i.e., a ref for the font file stream.
231
- // Returns false if there is no embedded font.
232
- bool getEmbeddedFontID(Ref *embID) const
233
- {
234
- *embID = embFontID;
235
- return embFontID != Ref::INVALID();
236
- }
237
-
238
- // Invalidate an embedded font
239
- // Returns false if there is no embedded font.
240
- bool invalidateEmbeddedFont()
241
- {
242
- if (embFontID != Ref::INVALID()) {
243
- embFontID = Ref::INVALID();
244
- return true;
245
- }
246
- return false;
247
- }
248
-
249
- // Get the PostScript font name for the embedded font. Returns
250
- // NULL if there is no embedded font.
251
- const GooString *getEmbeddedFontName() const { return embFontName; }
252
-
253
- // Get font descriptor flags.
254
- int getFlags() const { return flags; }
255
- bool isFixedWidth() const { return flags & fontFixedWidth; }
256
- bool isSerif() const { return flags & fontSerif; }
257
- bool isSymbolic() const { return flags & fontSymbolic; }
258
- bool isItalic() const { return flags & fontItalic; }
259
- bool isBold() const { return flags & fontBold; }
260
-
261
- // Return the Unicode map.
262
- virtual const CharCodeToUnicode *getToUnicode() const = 0;
263
-
264
- // Return the font matrix.
265
- const double *getFontMatrix() const { return fontMat; }
266
-
267
- // Return the font bounding box.
268
- const double *getFontBBox() const { return fontBBox; }
269
-
270
- // Return the ascent and descent values.
271
- double getAscent() const { return ascent; }
272
- double getDescent() const { return descent; }
273
-
274
- // Return the writing mode (0=horizontal, 1=vertical).
275
- virtual int getWMode() const { return 0; }
276
-
277
- // Locate the font file for this font. If <ps> is not null, includes PS
278
- // printer-resident fonts. Returns std::optional without a value on failure.
279
- std::optional<GfxFontLoc> locateFont(XRef *xref, PSOutputDev *ps);
280
-
281
- // Read an external or embedded font file into a buffer.
282
- std::optional<std::vector<unsigned char>> readEmbFontFile(XRef *xref);
283
-
284
- // Get the next char from a string <s> of <len> bytes, returning the
285
- // char <code>, its Unicode mapping <u>, its displacement vector
286
- // (<dx>, <dy>), and its origin offset vector (<ox>, <oy>). <uSize>
287
- // is the number of entries available in <u>, and <uLen> is set to
288
- // the number actually used. Returns the number of bytes used by
289
- // the char code.
290
- virtual int getNextChar(const char *s, int len, CharCode *code, Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const = 0;
291
-
292
- // Does this font have a toUnicode map?
293
- bool hasToUnicodeCMap() const { return hasToUnicode; }
294
-
295
- // Return the name of the encoding
296
- const std::string &getEncodingName() const { return encodingName; }
297
-
298
- // Return AGLFN names of ligatures in the Standard and Expert encodings
299
- // for use with fonts that are not compatible with the Standard 14 fonts.
300
- // http://sourceforge.net/adobe/aglfn/wiki/AGL%20Specification/
301
- static const char *getAlternateName(const char *name);
302
-
303
- protected:
304
- GfxFont(const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA);
305
-
306
- static GfxFontType getFontType(XRef *xref, Dict *fontDict, Ref *embID);
307
- void readFontDescriptor(XRef *xref, Dict *fontDict);
308
- CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits, CharCodeToUnicode *ctu);
309
- static std::optional<GfxFontLoc> getExternalFont(GooString *path, bool cid);
310
-
311
- const std::string tag; // PDF font tag
312
- const Ref id; // reference (used as unique ID)
313
- std::optional<std::string> name; // font name
314
- GooString *family; // font family
315
- Stretch stretch; // font stretch
316
- Weight weight; // font weight
317
- const GfxFontType type; // type of font
318
- int flags; // font descriptor flags
319
- GooString *embFontName; // name of embedded font
320
- Ref embFontID; // ref to embedded font file stream
321
- double fontMat[6]; // font matrix (Type 3 only)
322
- double fontBBox[4]; // font bounding box (Type 3 only)
323
- double missingWidth; // "default" width
324
- double ascent; // max height above baseline
325
- double descent; // max depth below baseline
326
- bool ok;
327
- bool hasToUnicode;
328
- std::string encodingName;
329
- };
330
-
331
- //------------------------------------------------------------------------
332
- // Gfx8BitFont
333
- //------------------------------------------------------------------------
334
-
335
- class POPPLER_PRIVATE_EXPORT Gfx8BitFont : public GfxFont
336
- {
337
- public:
338
- Gfx8BitFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict);
339
-
340
- int getNextChar(const char *s, int len, CharCode *code, Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const override;
341
-
342
- // Return the encoding.
343
- char **getEncoding() { return enc; }
344
-
345
- // Return the Unicode map.
346
- const CharCodeToUnicode *getToUnicode() const override;
347
-
348
- // Return the character name associated with <code>.
349
- const char *getCharName(int code) const { return enc[code]; }
350
-
351
- // Returns true if the PDF font specified an encoding.
352
- bool getHasEncoding() const { return hasEncoding; }
353
-
354
- // Returns true if the PDF font specified MacRomanEncoding.
355
- bool getUsesMacRomanEnc() const { return usesMacRomanEnc; }
356
-
357
- // Get width of a character.
358
- double getWidth(unsigned char c) const { return widths[c]; }
359
-
360
- // Return a char code-to-GID mapping for the provided font file.
361
- // (This is only useful for TrueType fonts.)
362
- int *getCodeToGIDMap(FoFiTrueType *ff);
363
-
364
- // Return the Type 3 CharProc dictionary, or NULL if none.
365
- Dict *getCharProcs();
366
-
367
- // Return the Type 3 CharProc for the character associated with <code>.
368
- Object getCharProc(int code);
369
- Object getCharProcNF(int code);
370
-
371
- // Return the Type 3 Resources dictionary, or NULL if none.
372
- Dict *getResources();
373
-
374
- private:
375
- ~Gfx8BitFont() override;
376
-
377
- const Base14FontMapEntry *base14; // for Base-14 fonts only; NULL otherwise
378
- char *enc[256]; // char code --> char name
379
- char encFree[256]; // boolean for each char name: if set,
380
- // the string is malloc'ed
381
- CharCodeToUnicode *ctu; // char code --> Unicode
382
- bool hasEncoding;
383
- bool usesMacRomanEnc;
384
- double widths[256]; // character widths
385
- Object charProcs; // Type 3 CharProcs dictionary
386
- Object resources; // Type 3 Resources dictionary
387
-
388
- friend class GfxFont;
389
- };
390
-
391
- //------------------------------------------------------------------------
392
- // GfxCIDFont
393
- //------------------------------------------------------------------------
394
-
395
- class POPPLER_PRIVATE_EXPORT GfxCIDFont : public GfxFont
396
- {
397
- public:
398
- GfxCIDFont(XRef *xref, const char *tagA, Ref idA, std::optional<std::string> &&nameA, GfxFontType typeA, Ref embFontIDA, Dict *fontDict);
399
-
400
- bool isCIDFont() const override { return true; }
401
-
402
- int getNextChar(const char *s, int len, CharCode *code, Unicode const **u, int *uLen, double *dx, double *dy, double *ox, double *oy) const override;
403
-
404
- // Return the writing mode (0=horizontal, 1=vertical).
405
- int getWMode() const override;
406
-
407
- // Return the Unicode map.
408
- const CharCodeToUnicode *getToUnicode() const override;
409
-
410
- // Get the collection name (<registry>-<ordering>).
411
- const GooString *getCollection() const;
412
-
413
- // Return the CID-to-GID mapping table. These should only be called
414
- // if type is fontCIDType2.
415
- int *getCIDToGID() const { return cidToGID; }
416
- unsigned int getCIDToGIDLen() const { return cidToGIDLen; }
417
-
418
- int *getCodeToGIDMap(FoFiTrueType *ff, int *codeToGIDLen);
419
-
420
- double getWidth(char *s, int len) const;
421
-
422
- private:
423
- ~GfxCIDFont() override;
424
-
425
- int mapCodeToGID(FoFiTrueType *ff, int cmapi, Unicode unicode, bool wmode);
426
- double getWidth(CID cid) const; // Get width of a character.
427
-
428
- GooString *collection; // collection name
429
- std::shared_ptr<CMap> cMap; // char code --> CID
430
- CharCodeToUnicode *ctu; // CID --> Unicode
431
- bool ctuUsesCharCode; // true: ctu maps char code to Unicode;
432
- // false: ctu maps CID to Unicode
433
- GfxFontCIDWidths widths; // character widths
434
- int *cidToGID; // CID --> GID mapping (for embedded
435
- // TrueType fonts)
436
- unsigned int cidToGIDLen;
437
- };
438
-
439
- //------------------------------------------------------------------------
440
- // GfxFontDict
441
- //------------------------------------------------------------------------
442
-
443
- class GfxFontDict
444
- {
445
- public:
446
- // Build the font dictionary, given the PDF font dictionary.
447
- GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict);
448
-
449
- GfxFontDict(const GfxFontDict &) = delete;
450
- GfxFontDict &operator=(const GfxFontDict &) = delete;
451
-
452
- // Get the specified font.
453
- std::shared_ptr<GfxFont> lookup(const char *tag) const;
454
-
455
- // Iterative access.
456
- int getNumFonts() const { return fonts.size(); }
457
- const std::shared_ptr<GfxFont> &getFont(int i) const { return fonts[i]; }
458
-
459
- private:
460
- int hashFontObject(Object *obj);
461
- void hashFontObject1(const Object *obj, FNVHash *h);
462
-
463
- std::vector<std::shared_ptr<GfxFont>> fonts;
464
- };
465
-
466
- #endif