@syncfusion/ej2-pdf-export 22.1.34 → 22.1.39

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 (169) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/ej2-pdf-export.min.js +2 -2
  3. package/dist/ej2-pdf-export.umd.min.js +2 -2
  4. package/dist/ej2-pdf-export.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-pdf-export.es2015.js +748 -93
  6. package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
  7. package/dist/es6/ej2-pdf-export.es5.js +933 -225
  8. package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
  9. package/dist/global/ej2-pdf-export.min.js +2 -2
  10. package/dist/global/ej2-pdf-export.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +5 -5
  13. package/src/implementation/document/pdf-catalog.d.ts +7 -0
  14. package/src/implementation/document/pdf-catalog.js +16 -0
  15. package/src/implementation/document/pdf-document-base.d.ts +13 -0
  16. package/src/implementation/document/pdf-document-base.js +18 -0
  17. package/src/implementation/document/pdf-viewer-preferences.d.ts +467 -0
  18. package/src/implementation/document/pdf-viewer-preferences.js +624 -0
  19. package/src/implementation/input-output/pdf-dictionary-properties.d.ts +55 -0
  20. package/src/implementation/input-output/pdf-dictionary-properties.js +55 -0
  21. package/dist/ts/implementation/actions/action.ts +0 -76
  22. package/dist/ts/implementation/actions/uri-action.ts +0 -52
  23. package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
  24. package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
  25. package/dist/ts/implementation/annotations/annotation.ts +0 -241
  26. package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
  27. package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
  28. package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
  29. package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
  30. package/dist/ts/implementation/collections/dictionary.ts +0 -150
  31. package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
  32. package/dist/ts/implementation/collections/utils.ts +0 -38
  33. package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
  34. package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
  35. package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
  36. package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
  37. package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
  38. package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
  39. package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
  40. package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
  41. package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
  42. package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
  43. package/dist/ts/implementation/document/pdf-catalog.ts +0 -52
  44. package/dist/ts/implementation/document/pdf-document-base.ts +0 -166
  45. package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
  46. package/dist/ts/implementation/document/pdf-document.ts +0 -342
  47. package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
  48. package/dist/ts/implementation/general/enum.ts +0 -21
  49. package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
  50. package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -62
  51. package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
  52. package/dist/ts/implementation/general/pdf-collection.ts +0 -41
  53. package/dist/ts/implementation/general/pdf-destination.ts +0 -170
  54. package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
  55. package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
  56. package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
  57. package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
  58. package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
  59. package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
  60. package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
  61. package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
  62. package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
  63. package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
  64. package/dist/ts/implementation/graphics/constants.ts +0 -31
  65. package/dist/ts/implementation/graphics/enum.ts +0 -413
  66. package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
  67. package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
  68. package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
  69. package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
  70. package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
  71. package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
  72. package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
  73. package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
  74. package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
  75. package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
  76. package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
  77. package/dist/ts/implementation/graphics/figures/path.ts +0 -646
  78. package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
  79. package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
  80. package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
  81. package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
  82. package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
  83. package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
  84. package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
  85. package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
  86. package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
  87. package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
  88. package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
  89. package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
  90. package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
  91. package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
  92. package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
  93. package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
  94. package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
  95. package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
  96. package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
  97. package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
  98. package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
  99. package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
  100. package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
  101. package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
  102. package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
  103. package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
  104. package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
  105. package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
  106. package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
  107. package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
  108. package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
  109. package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
  110. package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
  111. package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
  112. package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
  113. package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -439
  114. package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
  115. package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
  116. package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
  117. package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2424
  118. package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
  119. package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
  120. package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
  121. package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
  122. package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
  123. package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
  124. package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
  125. package/dist/ts/implementation/input-output/cross-table.ts +0 -21
  126. package/dist/ts/implementation/input-output/enum.ts +0 -16
  127. package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
  128. package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -515
  129. package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
  130. package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
  131. package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
  132. package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
  133. package/dist/ts/implementation/pages/enum.ts +0 -201
  134. package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
  135. package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
  136. package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
  137. package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
  138. package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
  139. package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
  140. package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
  141. package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -659
  142. package/dist/ts/implementation/pages/pdf-page.ts +0 -235
  143. package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
  144. package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
  145. package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
  146. package/dist/ts/implementation/pages/pdf-section.ts +0 -644
  147. package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
  148. package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
  149. package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
  150. package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
  151. package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
  152. package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
  153. package/dist/ts/implementation/primitives/pdf-stream.ts +0 -336
  154. package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
  155. package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -2027
  156. package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1193
  157. package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
  158. package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -470
  159. package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -853
  160. package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
  161. package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
  162. package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
  163. package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
  164. package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
  165. package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
  166. package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
  167. package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
  168. package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
  169. package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
@@ -1,606 +0,0 @@
1
- /**
2
- * PdfStandardFontMetricsFactory.ts class for EJ2-PDF
3
- */
4
- import { PdfFontStyle, PdfFontFamily } from './enum';
5
- import { PdfFontMetrics, StandardWidthTable } from './pdf-font-metrics';
6
- /**
7
- * @private
8
- * `Factory of the standard fonts metrics`.
9
- */
10
- export class PdfStandardFontMetricsFactory {
11
- /**
12
- * `Multiplier` os subscript superscript.
13
- * @private
14
- */
15
- private static readonly subSuperScriptFactor : number = 1.52;
16
- /**
17
- * `Ascender` value for the font.
18
- * @private
19
- */
20
- private static readonly helveticaAscent : number = 931;
21
- /**
22
- * `Ascender` value for the font.
23
- * @private
24
- */
25
- private static readonly helveticaDescent : number = -225;
26
- /**
27
- * `Font type`.
28
- * @private
29
- */
30
- private static readonly helveticaName : string = 'Helvetica';
31
- /**
32
- * `Ascender` value for the font.
33
- * @private
34
- */
35
- private static readonly helveticaBoldAscent : number = 962;
36
- /**
37
- * `Ascender` value for the font.
38
- * @private
39
- */
40
- private static readonly helveticaBoldDescent : number = -228;
41
- /**
42
- * `Font type`.
43
- * @private
44
- */
45
- private static readonly helveticaBoldName : string = 'Helvetica-Bold';
46
- /**
47
- * `Ascender` value for the font.
48
- * @private
49
- */
50
- private static readonly helveticaItalicAscent : number = 931;
51
- /**
52
- * `Ascender` value for the font.
53
- * @private
54
- */
55
- private static readonly helveticaItalicDescent : number = -225;
56
- /**
57
- * `Font type`.
58
- * @private
59
- */
60
- private static readonly helveticaItalicName : string = 'Helvetica-Oblique';
61
- /**
62
- * `Ascender` value for the font.
63
- * @private
64
- */
65
- private static readonly helveticaBoldItalicAscent : number = 962;
66
- /**
67
- * `Ascender` value for the font.
68
- * @private
69
- */
70
- private static readonly helveticaBoldItalicDescent : number = -228;
71
- /**
72
- * `Font type`.
73
- * @private
74
- */
75
- private static readonly helveticaBoldItalicName : string = 'Helvetica-BoldOblique';
76
- /**
77
- * `Ascender` value for the font.
78
- * @private
79
- */
80
- private static readonly courierAscent : number = 805;
81
- /**
82
- * `Ascender` value for the font.
83
- * @private
84
- */
85
- private static readonly courierDescent : number = -250;
86
- /**
87
- * `Font type`.
88
- * @private
89
- */
90
- private static readonly courierName : string = 'Courier';
91
- /**
92
- * `Ascender` value for the font.
93
- * @private
94
- */
95
- private static readonly courierBoldAscent : number = 801;
96
- /**
97
- * `Ascender` value for the font.
98
- * @private
99
- */
100
- private static readonly courierBoldDescent : number = -250;
101
- /**
102
- * `Font type`.
103
- * @private
104
- */
105
- private static readonly courierBoldName : string = 'Courier-Bold';
106
- /**
107
- * `Ascender` value for the font.
108
- * @private
109
- */
110
- private static readonly courierItalicAscent : number = 805;
111
- /**
112
- * `Ascender` value for the font.
113
- * @private
114
- */
115
- private static readonly courierItalicDescent : number = -250;
116
- /**
117
- * `Font type`.
118
- * @private
119
- */
120
- private static readonly courierItalicName : string = 'Courier-Oblique';
121
- /**
122
- * `Ascender` value for the font.
123
- * @private
124
- */
125
- private static readonly courierBoldItalicAscent : number = 801;
126
- /**
127
- * `Ascender` value for the font.
128
- * @private
129
- */
130
- private static readonly courierBoldItalicDescent : number = -250;
131
- /**
132
- * `Font type`.
133
- * @private
134
- */
135
- private static readonly courierBoldItalicName : string = 'Courier-BoldOblique';
136
- /**
137
- * `Ascender` value for the font.
138
- * @private
139
- */
140
- private static readonly timesAscent : number = 898;
141
- /**
142
- * `Ascender` value for the font.
143
- * @private
144
- */
145
- private static readonly timesDescent : number = -218;
146
- /**
147
- * `Font type`.
148
- * @private
149
- */
150
- private static readonly timesName : string = 'Times-Roman';
151
- /**
152
- * `Ascender` value for the font.
153
- * @private
154
- */
155
- private static readonly timesBoldAscent : number = 935;
156
- /**
157
- * `Ascender` value for the font.
158
- * @private
159
- */
160
- private static readonly timesBoldDescent : number = -218;
161
- /**
162
- * `Font type`.
163
- * @private
164
- */
165
- private static readonly timesBoldName : string = 'Times-Bold';
166
- /**
167
- * `Ascender` value for the font.
168
- * @private
169
- */
170
- private static readonly timesItalicAscent : number = 883;
171
- /**
172
- * `Ascender` value for the font.
173
- * @private
174
- */
175
- private static readonly timesItalicDescent : number = -217;
176
- /**
177
- * `Font type`.
178
- * @private
179
- */
180
- private static readonly timesItalicName : string = 'Times-Italic';
181
- /**
182
- * `Ascender` value for the font.
183
- * @private
184
- */
185
- private static readonly timesBoldItalicAscent : number = 921;
186
- /**
187
- * `Ascender` value for the font.
188
- * @private
189
- */
190
- private static readonly timesBoldItalicDescent : number = -218;
191
- /**
192
- * `Font type`.
193
- * @private
194
- */
195
- private static readonly timesBoldItalicName : string = 'Times-BoldItalic';
196
- /**
197
- * `Ascender` value for the font.
198
- * @private
199
- */
200
- private static readonly symbolAscent : number = 1010;
201
- /**
202
- * `Ascender` value for the font.
203
- * @private
204
- */
205
- private static readonly symbolDescent : number = -293;
206
- /**
207
- * `Font type`.
208
- * @private
209
- */
210
- private static readonly symbolName : string = 'Symbol';
211
- /**
212
- * `Ascender` value for the font.
213
- * @private
214
- */
215
- private static readonly zapfDingbatsAscent : number = 820;
216
- /**
217
- * `Ascender` value for the font.
218
- * @private
219
- */
220
- private static readonly zapfDingbatsDescent : number = -143;
221
- /**
222
- * `Font type`.
223
- * @private
224
- */
225
- private static readonly zapfDingbatsName : string = 'ZapfDingbats';
226
- /**
227
- * `Arial` widths table.
228
- * @private
229
- */
230
- private static arialWidth : number[] =
231
- [
232
- 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333,
233
- 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584,
234
- 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833,
235
- 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278,
236
- 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833,
237
- 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334,
238
- 584, 0, 556, 0, 222, 556, 333, 1000, 556, 556, 333, 1000, 667, 333, 1000, 0,
239
- 611, 0, 0, 222, 222, 333, 333, 350, 556, 1000, 333, 1000, 500, 333, 944, 0,
240
- 500, 667, 0, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 0,
241
- 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834,
242
- 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278,
243
- 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667,
244
- 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278,
245
- 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500,
246
- 556, 500
247
- ];
248
- /**
249
- * `Arial bold` widths table.
250
- * @private
251
- */
252
- private static arialBoldWidth : number[] =
253
- [
254
- 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333,
255
- 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584,
256
- 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833,
257
- 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333,
258
- 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889,
259
- 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389,
260
- 584, 0, 556, 0, 278, 556, 500, 1000, 556, 556, 333, 1000, 667, 333, 1000, 0,
261
- 611, 0, 0, 278, 278, 500, 500, 350, 556, 1000, 333, 1000, 556, 333, 944, 0,
262
- 500, 667, 0, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 0,
263
- 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834,
264
- 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278,
265
- 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667,
266
- 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278,
267
- 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556,
268
- 611, 556
269
- ];
270
- /**
271
- * `Fixed` widths table.
272
- * @private
273
- */
274
- private static fixedWidth : number[] =
275
- [
276
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
277
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
278
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
279
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
280
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
281
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
282
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
283
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
284
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
285
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
286
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
287
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
288
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
289
- 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600
290
- ];
291
- /**
292
- * `Times` widths table.
293
- * @private
294
- */
295
- private static timesRomanWidth : number[] =
296
- [
297
- 250, 333, 408, 500, 500, 833, 778, 180, 333, 333, 500, 564, 250, 333,
298
- 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564,
299
- 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889,
300
- 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333,
301
- 469, 500, 333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778,
302
- 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480,
303
- 541, 0, 500, 0, 333, 500, 444, 1000, 500, 500, 333, 1000, 556, 333, 889, 0,
304
- 611, 0, 0, 333, 333, 444, 444, 350, 500, 1000, 333, 980, 389, 333, 722, 0,
305
- 444, 722, 0, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 0,
306
- 760, 333, 400, 564, 300, 300, 333, 500, 453, 250, 333, 300, 310, 500, 750, 750,
307
- 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333,
308
- 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722,
309
- 556, 500, 444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278,
310
- 278, 278, 500, 500, 500, 500, 500, 500, 500, 564, 500, 500, 500, 500, 500, 500,
311
- 500, 500
312
- ];
313
- /**
314
- * `Times bold` widths table.
315
- * @private
316
- */
317
- private static timesRomanBoldWidth : number[] =
318
- [
319
- 250, 333, 555, 500, 500, 1000, 833, 278, 333, 333, 500, 570, 250, 333,
320
- 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570,
321
- 570, 500, 930, 722, 667, 722, 722, 667, 611, 778, 778, 389, 500, 778, 667, 944,
322
- 722, 778, 611, 778, 722, 556, 667, 722, 722, 1000, 722, 722, 667, 333, 278, 333,
323
- 581, 500, 333, 500, 556, 444, 556, 444, 333, 500, 556, 278, 333, 556, 278, 833,
324
- 556, 500, 556, 556, 444, 389, 333, 556, 500, 722, 500, 500, 444, 394, 220, 394,
325
- 520, 0, 500, 0, 333, 500, 500, 1000, 500, 500, 333, 1000, 556, 333, 1000, 0,
326
- 667, 0, 0, 333, 333, 500, 500, 350, 500, 1000, 333, 1000, 389, 333, 722, 0,
327
- 444, 722, 0, 333, 500, 500, 500, 500, 220, 500, 333, 747, 300, 500, 570, 0,
328
- 747, 333, 400, 570, 300, 300, 333, 556, 540, 250, 333, 300, 330, 500, 750, 750,
329
- 750, 500, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 389, 389,
330
- 389, 389, 722, 722, 778, 778, 778, 778, 778, 570, 778, 722, 722, 722, 722, 722,
331
- 611, 556, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278,
332
- 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 500,
333
- 556, 500
334
- ];
335
- /**
336
- * `Times italic` widths table.
337
- * @private
338
- */
339
- private static timesRomanItalicWidth : number[] =
340
- [
341
- 250, 333, 420, 500, 500, 833, 778, 214, 333, 333, 500, 675, 250, 333,
342
- 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 675, 675,
343
- 675, 500, 920, 611, 611, 667, 722, 611, 611, 722, 722, 333, 444, 667, 556, 833,
344
- 667, 722, 611, 722, 611, 500, 556, 722, 611, 833, 611, 556, 556, 389, 278, 389,
345
- 422, 500, 333, 500, 500, 444, 500, 444, 278, 500, 500, 278, 278, 444, 278, 722,
346
- 500, 500, 500, 500, 389, 389, 278, 500, 444, 667, 444, 444, 389, 400, 275, 400,
347
- 541, 0, 500, 0, 333, 500, 556, 889, 500, 500, 333, 1000, 500, 333, 944, 0,
348
- 556, 0, 0, 333, 333, 556, 556, 350, 500, 889, 333, 980, 389, 333, 667, 0,
349
- 389, 556, 0, 389, 500, 500, 500, 500, 275, 500, 333, 760, 276, 500, 675, 0,
350
- 760, 333, 400, 675, 300, 300, 333, 500, 523, 250, 333, 300, 310, 500, 750, 750,
351
- 750, 500, 611, 611, 611, 611, 611, 611, 889, 667, 611, 611, 611, 611, 333, 333,
352
- 333, 333, 722, 667, 722, 722, 722, 722, 722, 675, 722, 722, 722, 722, 722, 556,
353
- 611, 500, 500, 500, 500, 500, 500, 500, 667, 444, 444, 444, 444, 444, 278, 278,
354
- 278, 278, 500, 500, 500, 500, 500, 500, 500, 675, 500, 500, 500, 500, 500, 444,
355
- 500, 444
356
- ];
357
- /**
358
- * `Times bold italic` widths table.
359
- * @private
360
- */
361
- public static timesRomanBoldItalicWidths : number[] =
362
- [
363
- 250, 389, 555, 500, 500, 833, 778, 278, 333, 333, 500, 570, 250, 333,
364
- 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570,
365
- 570, 500, 832, 667, 667, 667, 722, 667, 667, 722, 778, 389, 500, 667, 611, 889,
366
- 722, 722, 611, 722, 667, 556, 611, 722, 667, 889, 667, 611, 611, 333, 278, 333,
367
- 570, 500, 333, 500, 500, 444, 500, 444, 333, 500, 556, 278, 278, 500, 278, 778,
368
- 556, 500, 500, 500, 389, 389, 278, 556, 444, 667, 500, 444, 389, 348, 220, 348,
369
- 570, 0, 500, 0, 333, 500, 500, 1000, 500, 500, 333, 1000, 556, 333, 944, 0,
370
- 611, 0, 0, 333, 333, 500, 500, 350, 500, 1000, 333, 1000, 389, 333, 722, 0,
371
- 389, 611, 0, 389, 500, 500, 500, 500, 220, 500, 333, 747, 266, 500, 606, 0,
372
- 747, 333, 400, 570, 300, 300, 333, 576, 500, 250, 333, 300, 300, 500, 750, 750,
373
- 750, 500, 667, 667, 667, 667, 667, 667, 944, 667, 667, 667, 667, 667, 389, 389,
374
- 389, 389, 722, 722, 722, 722, 722, 722, 722, 570, 722, 722, 722, 722, 722, 611,
375
- 611, 500, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278,
376
- 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 444,
377
- 500, 444
378
- ];
379
- /**
380
- * `Symbol` widths table.
381
- * @private
382
- */
383
- private static symbolWidth : number[] =
384
- [
385
- 250, 333, 713, 500, 549, 833, 778, 439, 333, 333, 500, 549, 250, 549,
386
- 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278,
387
- 549, 549, 549, 444, 549, 722, 667, 722, 612, 611, 763, 603, 722, 333,
388
- 631, 722, 686, 889, 722, 722, 768, 741, 556, 592, 611, 690, 439, 768,
389
- 645, 795, 611, 333, 863, 333, 658, 500, 500, 631, 549, 549, 494, 439,
390
- 521, 411, 603, 329, 603, 549, 549, 576, 521, 549, 549, 521, 549, 603,
391
- 439, 576, 713, 686, 493, 686, 494, 480, 200, 480, 549, 750, 620, 247,
392
- 549, 167, 713, 500, 753, 753, 753, 753, 1042, 987, 603, 987, 603, 400,
393
- 549, 411, 549, 549, 713, 494, 460, 549, 549, 549, 549, 1000, 603, 1000,
394
- 658, 823, 686, 795, 987, 768, 768, 823, 768, 768, 713, 713, 713, 713,
395
- 713, 713, 713, 768, 713, 790, 790, 890, 823, 549, 250, 713, 603, 603,
396
- 1042, 987, 603, 987, 603, 494, 329, 790, 790, 786, 713, 384, 384, 384,
397
- 384, 384, 384, 494, 494, 494, 494, 329, 274, 686, 686, 686, 384, 384,
398
- 384, 384, 384, 384, 494, 494, 494, -1
399
- ];
400
- /**
401
- * `Zip dingbats` widths table.
402
- * @private
403
- */
404
- private static zapfDingbatsWidth : number[] =
405
- [
406
- 278, 974, 961, 974, 980, 719, 789, 790, 791, 690, 960, 939, 549, 855,
407
- 911, 933, 911, 945, 974, 755, 846, 762, 761, 571, 677, 763, 760, 759,
408
- 754, 494, 552, 537, 577, 692, 786, 788, 788, 790, 793, 794, 816, 823,
409
- 789, 841, 823, 833, 816, 831, 923, 744, 723, 749, 790, 792, 695, 776,
410
- 768, 792, 759, 707, 708, 682, 701, 826, 815, 789, 789, 707, 687, 696,
411
- 689, 786, 787, 713, 791, 785, 791, 873, 761, 762, 762, 759, 759, 892,
412
- 892, 788, 784, 438, 138, 277, 415, 392, 392, 668, 668, 390, 390, 317,
413
- 317, 276, 276, 509, 509, 410, 410, 234, 234, 334, 334, 732, 544, 544,
414
- 910, 667, 760, 760, 776, 595, 694, 626, 788, 788, 788, 788, 788, 788,
415
- 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788,
416
- 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788, 788,
417
- 788, 788, 788, 788, 788, 788, 894, 838, 1016, 458, 748, 924, 748, 918,
418
- 927, 928, 928, 834, 873, 828, 924, 924, 917, 930, 931, 463, 883, 836,
419
- 836, 867, 867, 696, 696, 874, 874, 760, 946, 771, 865, 771, 888, 967,
420
- 888, 831, 873, 927, 970, 918
421
- ];
422
- /**
423
- * Returns `metrics` of the font.
424
- * @private
425
- */
426
- public static getMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle, size : number) : PdfFontMetrics {
427
- let metrics : PdfFontMetrics = null;
428
- switch (fontFamily) {
429
- case PdfFontFamily.Helvetica:
430
- metrics = this.getHelveticaMetrics(fontFamily, fontStyle, size);
431
- break;
432
-
433
- case PdfFontFamily.Courier:
434
- metrics = this.getCourierMetrics(fontFamily, fontStyle, size);
435
- break;
436
-
437
- case PdfFontFamily.TimesRoman:
438
- metrics = this.getTimesMetrics(fontFamily, fontStyle, size);
439
- break;
440
-
441
- case PdfFontFamily.Symbol:
442
- metrics = this.getSymbolMetrics(fontFamily, fontStyle, size);
443
- break;
444
-
445
- case PdfFontFamily.ZapfDingbats:
446
- metrics = this.getZapfDingbatsMetrics(fontFamily, fontStyle, size);
447
- break;
448
-
449
- default:
450
- metrics = this.getHelveticaMetrics(PdfFontFamily.Helvetica, fontStyle, size);
451
- break;
452
- }
453
-
454
- metrics.name = fontFamily.toString();
455
- metrics.subScriptSizeFactor = this.subSuperScriptFactor;
456
- metrics.superscriptSizeFactor = this.subSuperScriptFactor;
457
- return metrics;
458
- }
459
-
460
- // Implementation
461
- /**
462
- * Creates `Helvetica font metrics`.
463
- * @private
464
- */
465
- private static getHelveticaMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle,
466
- size : number) : PdfFontMetrics {
467
- let metrics : PdfFontMetrics = new PdfFontMetrics();
468
- if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {
469
- metrics.ascent = this.helveticaBoldItalicAscent;
470
- metrics.descent = this.helveticaBoldItalicDescent;
471
- metrics.postScriptName = this.helveticaBoldItalicName;
472
- metrics.size = size;
473
- metrics.widthTable = new StandardWidthTable(this.arialBoldWidth);
474
- metrics.height = metrics.ascent - metrics.descent;
475
- } else if ((fontStyle & PdfFontStyle.Bold) > 0) {
476
- metrics.ascent = this.helveticaBoldAscent;
477
- metrics.descent = this.helveticaBoldDescent;
478
- metrics.postScriptName = this.helveticaBoldName;
479
- metrics.size = size;
480
- metrics.widthTable = new StandardWidthTable(this.arialBoldWidth);
481
- metrics.height = metrics.ascent - metrics.descent;
482
- } else if ((fontStyle & PdfFontStyle.Italic) > 0) {
483
- metrics.ascent = this.helveticaItalicAscent;
484
- metrics.descent = this.helveticaItalicDescent;
485
- metrics.postScriptName = this.helveticaItalicName;
486
- metrics.size = size;
487
- metrics.widthTable = new StandardWidthTable(this.arialWidth);
488
- metrics.height = metrics.ascent - metrics.descent;
489
- } else {
490
- metrics.ascent = this.helveticaAscent;
491
- metrics.descent = this.helveticaDescent;
492
- metrics.postScriptName = this.helveticaName;
493
- metrics.size = size;
494
- metrics.widthTable = new StandardWidthTable(this.arialWidth);
495
- metrics.height = metrics.ascent - metrics.descent;
496
- }
497
-
498
- return metrics;
499
- }
500
- /**
501
- * Creates `Courier font metrics`.
502
- * @private
503
- */
504
- private static getCourierMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle,
505
- size : number) : PdfFontMetrics {
506
- let metrics : PdfFontMetrics = new PdfFontMetrics();
507
- if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {
508
- metrics.ascent = this.courierBoldItalicAscent;
509
- metrics.descent = this.courierBoldItalicDescent;
510
- metrics.postScriptName = this.courierBoldItalicName;
511
- metrics.size = size;
512
- metrics.widthTable = new StandardWidthTable(this.fixedWidth);
513
- metrics.height = metrics.ascent - metrics.descent;
514
- } else if ((fontStyle & PdfFontStyle.Bold) > 0) {
515
- metrics.ascent = this.courierBoldAscent;
516
- metrics.descent = this.courierBoldDescent;
517
- metrics.postScriptName = this.courierBoldName;
518
- metrics.size = size;
519
- metrics.widthTable = new StandardWidthTable(this.fixedWidth);
520
- metrics.height = metrics.ascent - metrics.descent;
521
- } else if ((fontStyle & PdfFontStyle.Italic) > 0) {
522
- metrics.ascent = this.courierItalicAscent;
523
- metrics.descent = this.courierItalicDescent;
524
- metrics.postScriptName = this.courierItalicName;
525
- metrics.size = size;
526
- metrics.widthTable = new StandardWidthTable(this.fixedWidth);
527
- metrics.height = metrics.ascent - metrics.descent;
528
- } else {
529
- metrics.ascent = this.courierAscent;
530
- metrics.descent = this.courierDescent;
531
- metrics.postScriptName = this.courierName;
532
- metrics.size = size;
533
- metrics.widthTable = new StandardWidthTable(this.fixedWidth);
534
- metrics.height = metrics.ascent - metrics.descent;
535
- }
536
-
537
- return metrics;
538
- }
539
- /**
540
- * Creates `Times font metrics`.
541
- * @private
542
- */
543
- private static getTimesMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle, size : number) : PdfFontMetrics {
544
- let metrics : PdfFontMetrics = new PdfFontMetrics();
545
- if ((fontStyle & PdfFontStyle.Bold) > 0 && (fontStyle & PdfFontStyle.Italic) > 0) {
546
- metrics.ascent = this.timesBoldItalicAscent;
547
- metrics.descent = this.timesBoldItalicDescent;
548
- metrics.postScriptName = this.timesBoldItalicName;
549
- metrics.size = size;
550
- metrics.widthTable = new StandardWidthTable(this.timesRomanBoldItalicWidths);
551
- metrics.height = metrics.ascent - metrics.descent;
552
- } else if ((fontStyle & PdfFontStyle.Bold) > 0) {
553
- metrics.ascent = this.timesBoldAscent;
554
- metrics.descent = this.timesBoldDescent;
555
- metrics.postScriptName = this.timesBoldName;
556
- metrics.size = size;
557
- metrics.widthTable = new StandardWidthTable(this.timesRomanBoldWidth);
558
- metrics.height = metrics.ascent - metrics.descent;
559
- } else if ((fontStyle & PdfFontStyle.Italic) > 0) {
560
- metrics.ascent = this.timesItalicAscent;
561
- metrics.descent = this.timesItalicDescent;
562
- metrics.postScriptName = this.timesItalicName;
563
- metrics.size = size;
564
- metrics.widthTable = new StandardWidthTable(this.timesRomanItalicWidth);
565
- metrics.height = metrics.ascent - metrics.descent;
566
- } else {
567
- metrics.ascent = this.timesAscent;
568
- metrics.descent = this.timesDescent;
569
- metrics.postScriptName = this.timesName;
570
- metrics.size = size;
571
- metrics.widthTable = new StandardWidthTable(this.timesRomanWidth);
572
- metrics.height = metrics.ascent - metrics.descent;
573
- }
574
- return metrics;
575
- }
576
- /**
577
- * Creates `Symbol font metrics`.
578
- * @private
579
- */
580
- private static getSymbolMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle,
581
- size : number) : PdfFontMetrics {
582
- let metrics : PdfFontMetrics = new PdfFontMetrics();
583
- metrics.ascent = this.symbolAscent;
584
- metrics.descent = this.symbolDescent;
585
- metrics.postScriptName = this.symbolName;
586
- metrics.size = size;
587
- metrics.widthTable = new StandardWidthTable(this.symbolWidth);
588
- metrics.height = metrics.ascent - metrics.descent;
589
- return metrics;
590
- }
591
- /**
592
- * Creates `ZapfDingbats font metrics`.
593
- * @private
594
- */
595
- private static getZapfDingbatsMetrics(fontFamily : PdfFontFamily, fontStyle : PdfFontStyle,
596
- size : number) : PdfFontMetrics {
597
- let metrics : PdfFontMetrics = new PdfFontMetrics();
598
- metrics.ascent = this.zapfDingbatsAscent;
599
- metrics.descent = this.zapfDingbatsDescent;
600
- metrics.postScriptName = this.zapfDingbatsName;
601
- metrics.size = size;
602
- metrics.widthTable = new StandardWidthTable(this.zapfDingbatsWidth);
603
- metrics.height = metrics.ascent - metrics.descent;
604
- return metrics;
605
- }
606
- }