@wirabyte/w-pdfmaker 0.0.0-stage → 1.0.1

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 (142) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/LICENSE +22 -0
  3. package/NOTICE.md +39 -0
  4. package/README.md +106 -2
  5. package/build/fonts/Roboto/Roboto-Italic.ttf +0 -0
  6. package/build/fonts/Roboto/Roboto-Medium.ttf +0 -0
  7. package/build/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  8. package/build/fonts/Roboto/Roboto-Regular.ttf +0 -0
  9. package/build/fonts/Roboto.js +27 -0
  10. package/build/pdfmake.js +103161 -0
  11. package/build/pdfmake.js.map +1 -0
  12. package/build/pdfmake.min.js +3 -0
  13. package/build/pdfmake.min.js.map +1 -0
  14. package/build/standard-fonts/Courier.js +9 -0
  15. package/build/standard-fonts/Helvetica.js +9 -0
  16. package/build/standard-fonts/Symbol.js +9 -0
  17. package/build/standard-fonts/Times.js +9 -0
  18. package/build/standard-fonts/ZapfDingbats.js +9 -0
  19. package/build/vfs_fonts.js +6 -0
  20. package/build-vfs.js +44 -0
  21. package/fonts/Roboto/Roboto-Italic.ttf +0 -0
  22. package/fonts/Roboto/Roboto-Medium.ttf +0 -0
  23. package/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  24. package/fonts/Roboto/Roboto-Regular.ttf +0 -0
  25. package/fonts/Roboto.js +8 -0
  26. package/fonts/THSarabunIT9/LICENSE.txt +7 -0
  27. package/fonts/THSarabunIT9/THSarabunIT9-Bold.ttf +0 -0
  28. package/fonts/THSarabunIT9/THSarabunIT9-BoldItalic.ttf +0 -0
  29. package/fonts/THSarabunIT9/THSarabunIT9-Italic.ttf +0 -0
  30. package/fonts/THSarabunIT9/THSarabunIT9.ttf +0 -0
  31. package/fonts/THSarabunNew/COPYING.GPLv2 +339 -0
  32. package/fonts/THSarabunNew/LICENSE.txt +13 -0
  33. package/fonts/THSarabunNew/THSarabunNew-Bold.ttf +0 -0
  34. package/fonts/THSarabunNew/THSarabunNew-BoldItalic.ttf +0 -0
  35. package/fonts/THSarabunNew/THSarabunNew-Italic.ttf +0 -0
  36. package/fonts/THSarabunNew/THSarabunNew.ttf +0 -0
  37. package/index.d.ts +167 -0
  38. package/interfaces.d.ts +2779 -0
  39. package/js/DocMeasure.js +695 -0
  40. package/js/DocPreprocessor.js +263 -0
  41. package/js/DocumentContext.js +563 -0
  42. package/js/ElementWriter.js +488 -0
  43. package/js/LayoutBuilder.js +1525 -0
  44. package/js/Line.js +105 -0
  45. package/js/OutputDocument.js +73 -0
  46. package/js/OutputDocumentServer.js +34 -0
  47. package/js/PDFDocument.js +322 -0
  48. package/js/PageElementWriter.js +302 -0
  49. package/js/PageSize.js +74 -0
  50. package/js/Printer.js +275 -0
  51. package/js/Renderer.js +439 -0
  52. package/js/SVGMeasure.js +94 -0
  53. package/js/StyleContextStack.js +191 -0
  54. package/js/TableProcessor.js +658 -0
  55. package/js/TextBreaker.js +164 -0
  56. package/js/TextDecorator.js +164 -0
  57. package/js/TextInlines.js +212 -0
  58. package/js/URLResolver.js +122 -0
  59. package/js/base.js +125 -0
  60. package/js/browser-extensions/OutputDocumentBrowser.js +82 -0
  61. package/js/browser-extensions/fonts/Roboto.js +38 -0
  62. package/js/browser-extensions/fonts/thai.js +28 -0
  63. package/js/browser-extensions/index.js +88 -0
  64. package/js/browser-extensions/pageUrls.js +79 -0
  65. package/js/browser-extensions/pdfMake.js +3 -0
  66. package/js/browser-extensions/standard-fonts/Courier.js +20 -0
  67. package/js/browser-extensions/standard-fonts/Helvetica.js +20 -0
  68. package/js/browser-extensions/standard-fonts/Symbol.js +17 -0
  69. package/js/browser-extensions/standard-fonts/Times.js +20 -0
  70. package/js/browser-extensions/standard-fonts/ZapfDingbats.js +17 -0
  71. package/js/browser-extensions/virtual-fs-cjs.js +3 -0
  72. package/js/columnCalculator.js +159 -0
  73. package/js/helpers/node.js +122 -0
  74. package/js/helpers/tools.js +46 -0
  75. package/js/helpers/variableType.js +59 -0
  76. package/js/imageFallback.js +23 -0
  77. package/js/index.js +45 -0
  78. package/js/mergeStamp.js +194 -0
  79. package/js/pageNumbering.js +48 -0
  80. package/js/qrEnc.js +721 -0
  81. package/js/standardPageSizes.js +56 -0
  82. package/js/tableLayouts.js +98 -0
  83. package/js/thai.js +201 -0
  84. package/js/virtual-fs.js +82 -0
  85. package/package.json +93 -4
  86. package/skills/w-pdfmaker/SKILL.md +171 -0
  87. package/skills/w-pdfmaker/references/browser.md +36 -0
  88. package/skills/w-pdfmaker/references/document-definition.md +241 -0
  89. package/skills/w-pdfmaker/references/images.md +90 -0
  90. package/skills/w-pdfmaker/references/merge-stamp.md +94 -0
  91. package/skills/w-pdfmaker/references/thai.md +67 -0
  92. package/src/DocMeasure.js +780 -0
  93. package/src/DocPreprocessor.js +293 -0
  94. package/src/DocumentContext.js +605 -0
  95. package/src/ElementWriter.js +550 -0
  96. package/src/LayoutBuilder.js +1689 -0
  97. package/src/Line.js +114 -0
  98. package/src/OutputDocument.js +75 -0
  99. package/src/OutputDocumentServer.js +38 -0
  100. package/src/PDFDocument.js +352 -0
  101. package/src/PageElementWriter.js +343 -0
  102. package/src/PageSize.js +53 -0
  103. package/src/Printer.js +289 -0
  104. package/src/Renderer.js +468 -0
  105. package/src/SVGMeasure.js +109 -0
  106. package/src/StyleContextStack.js +208 -0
  107. package/src/TableProcessor.js +719 -0
  108. package/src/TextBreaker.js +166 -0
  109. package/src/TextDecorator.js +191 -0
  110. package/src/TextInlines.js +229 -0
  111. package/src/URLResolver.js +122 -0
  112. package/src/base.js +143 -0
  113. package/src/browser-extensions/OutputDocumentBrowser.js +80 -0
  114. package/src/browser-extensions/fonts/Roboto.js +27 -0
  115. package/src/browser-extensions/fonts/thai.js +23 -0
  116. package/src/browser-extensions/index.js +91 -0
  117. package/src/browser-extensions/pageUrls.js +67 -0
  118. package/src/browser-extensions/pdfMake.js +1 -0
  119. package/src/browser-extensions/standard-fonts/Courier.js +25 -0
  120. package/src/browser-extensions/standard-fonts/Helvetica.js +25 -0
  121. package/src/browser-extensions/standard-fonts/Symbol.js +17 -0
  122. package/src/browser-extensions/standard-fonts/Times.js +25 -0
  123. package/src/browser-extensions/standard-fonts/ZapfDingbats.js +17 -0
  124. package/src/browser-extensions/virtual-fs-cjs.js +1 -0
  125. package/src/columnCalculator.js +160 -0
  126. package/src/helpers/node.js +134 -0
  127. package/src/helpers/tools.js +44 -0
  128. package/src/helpers/variableType.js +50 -0
  129. package/src/imageFallback.js +18 -0
  130. package/src/index.js +45 -0
  131. package/src/mergeStamp.js +132 -0
  132. package/src/pageNumbering.js +45 -0
  133. package/src/qrEnc.js +796 -0
  134. package/src/standardPageSizes.js +52 -0
  135. package/src/tableLayouts.js +100 -0
  136. package/src/thai.js +170 -0
  137. package/src/virtual-fs.js +92 -0
  138. package/standard-fonts/Courier.js +8 -0
  139. package/standard-fonts/Helvetica.js +8 -0
  140. package/standard-fonts/Symbol.js +5 -0
  141. package/standard-fonts/Times.js +8 -0
  142. package/standard-fonts/ZapfDingbats.js +5 -0
@@ -0,0 +1,52 @@
1
+ export default {
2
+ '4A0': [4767.87, 6740.79],
3
+ '2A0': [3370.39, 4767.87],
4
+ A0: [2383.94, 3370.39],
5
+ A1: [1683.78, 2383.94],
6
+ A2: [1190.55, 1683.78],
7
+ A3: [841.89, 1190.55],
8
+ A4: [595.28, 841.89],
9
+ A5: [419.53, 595.28],
10
+ A6: [297.64, 419.53],
11
+ A7: [209.76, 297.64],
12
+ A8: [147.40, 209.76],
13
+ A9: [104.88, 147.40],
14
+ A10: [73.70, 104.88],
15
+ B0: [2834.65, 4008.19],
16
+ B1: [2004.09, 2834.65],
17
+ B2: [1417.32, 2004.09],
18
+ B3: [1000.63, 1417.32],
19
+ B4: [708.66, 1000.63],
20
+ B5: [498.90, 708.66],
21
+ B6: [354.33, 498.90],
22
+ B7: [249.45, 354.33],
23
+ B8: [175.75, 249.45],
24
+ B9: [124.72, 175.75],
25
+ B10: [87.87, 124.72],
26
+ C0: [2599.37, 3676.54],
27
+ C1: [1836.85, 2599.37],
28
+ C2: [1298.27, 1836.85],
29
+ C3: [918.43, 1298.27],
30
+ C4: [649.13, 918.43],
31
+ C5: [459.21, 649.13],
32
+ C6: [323.15, 459.21],
33
+ C7: [229.61, 323.15],
34
+ C8: [161.57, 229.61],
35
+ C9: [113.39, 161.57],
36
+ C10: [79.37, 113.39],
37
+ RA0: [2437.80, 3458.27],
38
+ RA1: [1729.13, 2437.80],
39
+ RA2: [1218.90, 1729.13],
40
+ RA3: [864.57, 1218.90],
41
+ RA4: [609.45, 864.57],
42
+ SRA0: [2551.18, 3628.35],
43
+ SRA1: [1814.17, 2551.18],
44
+ SRA2: [1275.59, 1814.17],
45
+ SRA3: [907.09, 1275.59],
46
+ SRA4: [637.80, 907.09],
47
+ EXECUTIVE: [521.86, 756.00],
48
+ FOLIO: [612.00, 936.00],
49
+ LEGAL: [612.00, 1008.00],
50
+ LETTER: [612.00, 792.00],
51
+ TABLOID: [792.00, 1224.00]
52
+ };
@@ -0,0 +1,100 @@
1
+ /*eslint no-unused-vars: ["error", {"args": "none"}]*/
2
+
3
+ export {
4
+ tableLayouts,
5
+ defaultTableLayout
6
+ };
7
+
8
+ const tableLayouts = {
9
+ noBorders: {
10
+ hLineWidth(i) {
11
+ return 0;
12
+ },
13
+ vLineWidth(i) {
14
+ return 0;
15
+ },
16
+ paddingLeft(i) {
17
+ return i && 4 || 0;
18
+ },
19
+ paddingRight(i, node) {
20
+ return (i < node.table.widths.length - 1) ? 4 : 0;
21
+ }
22
+ },
23
+ headerLineOnly: {
24
+ hLineWidth(i, node) {
25
+ if (i === 0 || i === node.table.body.length) {
26
+ return 0;
27
+ }
28
+ return (i === node.table.headerRows) ? 2 : 0;
29
+ },
30
+ vLineWidth(i) {
31
+ return 0;
32
+ },
33
+ paddingLeft(i) {
34
+ return i === 0 ? 0 : 8;
35
+ },
36
+ paddingRight(i, node) {
37
+ return (i === node.table.widths.length - 1) ? 0 : 8;
38
+ }
39
+ },
40
+ lightHorizontalLines: {
41
+ hLineWidth(i, node) {
42
+ if (i === 0 || i === node.table.body.length) {
43
+ return 0;
44
+ }
45
+ return (i === node.table.headerRows) ? 2 : 1;
46
+ },
47
+ vLineWidth(i) {
48
+ return 0;
49
+ },
50
+ hLineColor(i) {
51
+ return i === 1 ? 'black' : '#aaa';
52
+ },
53
+ paddingLeft(i) {
54
+ return i === 0 ? 0 : 8;
55
+ },
56
+ paddingRight(i, node) {
57
+ return (i === node.table.widths.length - 1) ? 0 : 8;
58
+ }
59
+ }
60
+ };
61
+
62
+ const defaultTableLayout = {
63
+ hLineWidth(i, node) {
64
+ return 1;
65
+ },
66
+ vLineWidth(i, node) {
67
+ return 1;
68
+ },
69
+ hLineColor(i, node) {
70
+ return 'black';
71
+ },
72
+ vLineColor(i, node) {
73
+ return 'black';
74
+ },
75
+ hLineStyle(i, node) {
76
+ return null;
77
+ },
78
+ vLineStyle(i, node) {
79
+ return null;
80
+ },
81
+ paddingLeft(i, node) {
82
+ return 4;
83
+ },
84
+ paddingRight(i, node) {
85
+ return 4;
86
+ },
87
+ paddingTop(i, node) {
88
+ return 2;
89
+ },
90
+ paddingBottom(i, node) {
91
+ return 2;
92
+ },
93
+ fillColor(i, node) {
94
+ return null;
95
+ },
96
+ fillOpacity(i, node) {
97
+ return 1;
98
+ },
99
+ defaultBorder: true
100
+ };
package/src/thai.js ADDED
@@ -0,0 +1,170 @@
1
+ import { LineBreaker } from 'linebreak';
2
+
3
+ // w-pdfmaker: Thai support kept in one file so upstream merges only touch short call sites.
4
+
5
+ const THAI = /[฀-๿]/;
6
+ const hasSegmenter = typeof Intl !== 'undefined' && typeof Intl.Segmenter === 'function';
7
+ const thaiWords = hasSegmenter ? new Intl.Segmenter('th', { granularity: 'word' }) : null;
8
+ const graphemes = hasSegmenter ? new Intl.Segmenter('th', { granularity: 'grapheme' }) : null;
9
+
10
+ /**
11
+ * Line break opportunities: UAX #14 from linebreak, plus breaks between Thai words
12
+ * (UAX #14 has no Thai dictionary, so a Thai run would otherwise be one unbreakable word).
13
+ *
14
+ * @param {string} text
15
+ * @returns {Array<{position: number, required: boolean}>}
16
+ */
17
+ export function lineBreaks(text) {
18
+ const breaks = new Map();
19
+ const breaker = new LineBreaker(text);
20
+ let bk;
21
+ while ((bk = breaker.nextBreak())) {
22
+ breaks.set(bk.position, bk.required);
23
+ }
24
+
25
+ if (thaiWords && THAI.test(text)) {
26
+ for (const { index, segment } of thaiWords.segment(text)) {
27
+ const end = index + segment.length;
28
+ if (end < text.length && THAI.test(text[end - 1]) && THAI.test(text[end]) && !breaks.has(end)) {
29
+ breaks.set(end, false);
30
+ }
31
+ }
32
+ }
33
+
34
+ return Array.from(breaks, ([position, required]) => ({ position, required })).sort((a, b) => a.position - b.position);
35
+ }
36
+
37
+ /**
38
+ * alignment: 'distribute' (like Thai Distributed in Word): spread the free space evenly between
39
+ * grapheme clusters instead of between words. Clusters keep vowels and tone marks on their consonant,
40
+ * which PDF character spacing (Tc) would not.
41
+ *
42
+ * @param {object} line
43
+ * @param {number} availableWidth
44
+ */
45
+ export function distributeLine(line, availableWidth) {
46
+ const extra = availableWidth - line.getWidth();
47
+ // Like justify, a single-inline line (e.g. an ordered list marker "10. ") is not spread.
48
+ if (!graphemes || line.inlines.length < 2 || line.newLineForced || line.lastLineInParagraph || extra <= 0.01) {
49
+ return;
50
+ }
51
+
52
+ const pieces = [];
53
+ line.inlines.forEach(inline => {
54
+ const parts = typeof inline.text === 'string' && !inline._pageNodeRef ? Array.from(graphemes.segment(inline.text), g => g.segment) : [];
55
+ if (parts.length <= 1) {
56
+ pieces.push(inline);
57
+ return;
58
+ }
59
+ const widths = parts.map(part => inline.font.widthOfString(part, inline.fontSize, inline.fontFeatures));
60
+ const total = widths.reduce((a, b) => a + b, 0);
61
+ const scale = total > 0 ? inline.width / total : 0;
62
+ let x = inline.x;
63
+ parts.forEach((part, i) => {
64
+ pieces.push(Object.assign({}, inline, { text: part, x: x, width: widths[i] * scale }));
65
+ x += widths[i] * scale;
66
+ });
67
+ });
68
+
69
+ // A gap goes before every cluster with width between the first and last visible one:
70
+ // trimmed leading/trailing whitespace and zero-width clusters (e.g. ZWSP) get none.
71
+ const visible = pieces.map(piece => piece.text.trim() !== '');
72
+ const first = visible.indexOf(true);
73
+ const last = visible.lastIndexOf(true);
74
+ const takesGap = i => i > first && i <= last && pieces[i].width > 0;
75
+ const slots = pieces.filter((piece, i) => takesGap(i)).length;
76
+ if (!slots) {
77
+ return;
78
+ }
79
+
80
+ let offset = 0;
81
+ pieces.forEach((piece, i) => {
82
+ const shift = takesGap(i) ? extra / slots : 0;
83
+ offset += shift;
84
+ piece.x += offset;
85
+ if (i > first) {
86
+ piece.justifyShift = shift;
87
+ }
88
+ });
89
+ line.inlines = pieces;
90
+ }
91
+
92
+ export const DEFAULT_FONT = 'THSarabunNew';
93
+
94
+ /**
95
+ * Descriptors of the bundled Thai fonts (fonts/<family>/<family>[-Style].ttf).
96
+ *
97
+ * @param {string} dir path of the fonts folder (Node) or '' for virtual file system keys (browser)
98
+ * @returns {object}
99
+ */
100
+ export function thaiFonts(dir) {
101
+ const family = name => ({
102
+ normal: `${dir}${name}/${name}.ttf`,
103
+ bold: `${dir}${name}/${name}-Bold.ttf`,
104
+ italics: `${dir}${name}/${name}-Italic.ttf`,
105
+ bolditalics: `${dir}${name}/${name}-BoldItalic.ttf`
106
+ });
107
+ return { THSarabunNew: family('THSarabunNew'), THSarabunIT9: family('THSarabunIT9') };
108
+ }
109
+
110
+ /**
111
+ * Thai defaults for the document: the bundled Thai font when no font is picked (pdfmake would use Roboto),
112
+ * skipped when that font is not registered (e.g. setFonts() replaced all fonts), and 16pt for the bundled
113
+ * Thai fonts when no size is set (Thai official documents use 16pt; pdfmake would use 12).
114
+ *
115
+ * @param {object} docDefinition
116
+ * @param {object} fonts registered fonts
117
+ * @returns {object}
118
+ */
119
+ export function withThaiDefaults(docDefinition, fonts) {
120
+ const style = Object.assign({}, docDefinition.defaultStyle);
121
+ if (!style.font && fonts && fonts[DEFAULT_FONT]) {
122
+ style.font = DEFAULT_FONT;
123
+ }
124
+ if (style.fontSize === undefined && (style.font === 'THSarabunNew' || style.font === 'THSarabunIT9')) {
125
+ style.fontSize = 16;
126
+ }
127
+ const defaultStyle = docDefinition.defaultStyle || {};
128
+ if (style.font === defaultStyle.font && style.fontSize === defaultStyle.fontSize) {
129
+ return docDefinition;
130
+ }
131
+ return Object.assign({}, docDefinition, { defaultStyle: style });
132
+ }
133
+
134
+ /**
135
+ * fontkit shapes SARA AM (U+0E33) as NIKHAHIT + SARA AA glyphs, so viewers copy and search "ํา".
136
+ * Text containing it gets an ActualText span with the original string.
137
+ *
138
+ * @param {string} text
139
+ * @returns {boolean}
140
+ */
141
+ export function needsActualText(text) {
142
+ return typeof text === 'string' && text.includes('ำ');
143
+ }
144
+
145
+ /**
146
+ * Splits text into the grapheme clusters that contain SARA AM and the text between them, so only
147
+ * those clusters get an ActualText span. MuPDF matches ActualText against the glyphs and, at a
148
+ * character with no glyph of its own (ำ), outputs the rest of the ActualText and then the following
149
+ * glyphs again: a span over "จำนวน" copies as "จำนวนนวน", a span over "จำ" copies correctly.
150
+ * Thai shaping does not cross cluster boundaries, so drawing the parts separately looks the same.
151
+ *
152
+ * @param {string} text
153
+ * @returns {Array<{text: string, actual: boolean}>}
154
+ */
155
+ export function actualTextRuns(text) {
156
+ if (!graphemes) {
157
+ return [{ text, actual: true }];
158
+ }
159
+ const runs = [];
160
+ for (const { segment } of graphemes.segment(text)) {
161
+ const actual = segment.includes('ำ');
162
+ const last = runs[runs.length - 1];
163
+ if (last && !last.actual && !actual) {
164
+ last.text += segment;
165
+ } else {
166
+ runs.push({ text: segment, actual });
167
+ }
168
+ }
169
+ return runs;
170
+ }
@@ -0,0 +1,92 @@
1
+ const normalizeFilename = filename => {
2
+ if (filename.indexOf(__dirname) === 0) {
3
+ filename = filename.substring(__dirname.length);
4
+ }
5
+
6
+ if (filename.indexOf('/') === 0) {
7
+ filename = filename.substring(1);
8
+ }
9
+
10
+ return filename;
11
+ };
12
+
13
+ export class VirtualFileSystem {
14
+ constructor(parent = null) {
15
+ this.storage = {};
16
+ this.parent = parent;
17
+ }
18
+
19
+ /**
20
+ * @param {string} filename
21
+ * @returns {boolean}
22
+ */
23
+ existsSync(filename) {
24
+ if (typeof filename !== 'string') {
25
+ return false;
26
+ }
27
+
28
+ if (this.parent && this.parent.existsSync(filename)) {
29
+ return true;
30
+ }
31
+
32
+ const normalizedFilename = normalizeFilename(filename);
33
+ return typeof this.storage[normalizedFilename] !== 'undefined';
34
+ }
35
+
36
+ /**
37
+ * @param {string} filename
38
+ * @param {?string|?object} options
39
+ * @returns {string|Buffer}
40
+ */
41
+ readFileSync(filename, options) {
42
+ if (this.parent && this.parent.existsSync(filename)) {
43
+ return this.parent.readFileSync(filename, options);
44
+ }
45
+
46
+ const normalizedFilename = normalizeFilename(filename);
47
+ const encoding = typeof options === 'object' ? options.encoding : options;
48
+
49
+ if (!this.existsSync(normalizedFilename)) {
50
+ throw new Error(`File '${normalizedFilename}' not found in virtual file system`);
51
+ }
52
+
53
+ const buffer = this.storage[normalizedFilename];
54
+ if (encoding) {
55
+ return buffer.toString(encoding);
56
+ }
57
+
58
+ return buffer;
59
+ }
60
+
61
+ /**
62
+ * @param {string} filename
63
+ * @param {string|Buffer} content
64
+ * @param {?string|?object} options
65
+ */
66
+ writeFileSync(filename, content, options) {
67
+ const normalizedFilename = normalizeFilename(filename);
68
+ const encoding = typeof options === 'object' ? options.encoding : options;
69
+
70
+ if (!content && !options) {
71
+ throw new Error('No content');
72
+ }
73
+
74
+ this.storage[normalizedFilename] = encoding || typeof content === 'string' ? Buffer.from(content, encoding) : content;
75
+ }
76
+
77
+ /**
78
+ * @param {string} filename
79
+ */
80
+ unlinkSync(filename) {
81
+ const normalizedFilename = normalizeFilename(filename);
82
+
83
+ if (typeof this.storage[normalizedFilename] === 'undefined') {
84
+ throw new Error(`File '${normalizedFilename}' not found in virtual file system`);
85
+ }
86
+
87
+ delete this.storage[normalizedFilename];
88
+ }
89
+
90
+ }
91
+
92
+ export default new VirtualFileSystem();
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ Courier: {
3
+ normal: 'Courier',
4
+ bold: 'Courier-Bold',
5
+ italics: 'Courier-Oblique',
6
+ bolditalics: 'Courier-BoldOblique'
7
+ }
8
+ };
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ Helvetica: {
3
+ normal: 'Helvetica',
4
+ bold: 'Helvetica-Bold',
5
+ italics: 'Helvetica-Oblique',
6
+ bolditalics: 'Helvetica-BoldOblique'
7
+ }
8
+ };
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ Symbol: {
3
+ normal: 'Symbol'
4
+ }
5
+ };
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ Times: {
3
+ normal: 'Times-Roman',
4
+ bold: 'Times-Bold',
5
+ italics: 'Times-Italic',
6
+ bolditalics: 'Times-BoldItalic'
7
+ }
8
+ };
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ ZapfDingbats: {
3
+ normal: 'ZapfDingbats'
4
+ }
5
+ };