@peculiar/pdf-font 2.0.0 → 2.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.
- package/build/index.js +3 -6
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -156,9 +156,6 @@ __decorate([asn.AsnProp({ type: asn.AsnPropTypes.Integer })], FontInfo.prototype
|
|
|
156
156
|
__decorate([asn.AsnProp({ type: asn.AsnPropTypes.Integer })], FontInfo.prototype, "descent", void 0);
|
|
157
157
|
FontInfo = _FontInfo = __decorate([asn.AsnType({ type: asn.AsnTypeTypes.Sequence })], FontInfo);
|
|
158
158
|
// src/FontFactory.ts
|
|
159
|
-
function toFontjsStream(stream) {
|
|
160
|
-
return stream;
|
|
161
|
-
}
|
|
162
159
|
var FontFactory = class {
|
|
163
160
|
static {
|
|
164
161
|
this.cache = /* @__PURE__ */ new Map();
|
|
@@ -178,7 +175,7 @@ var FontFactory = class {
|
|
|
178
175
|
}
|
|
179
176
|
static createFile(source) {
|
|
180
177
|
const buffer = toArrayBuffer(source);
|
|
181
|
-
const font = fontjs.Font.fromStream(
|
|
178
|
+
const font = fontjs.Font.fromStream(new bs.SeqStream({ stream: new bs.ByteStream({ buffer }) }));
|
|
182
179
|
const fontInfo = new FontInfo();
|
|
183
180
|
const name = font.tables.get(fontjs.Tables.NAME.tag);
|
|
184
181
|
if (name) {
|
|
@@ -229,7 +226,7 @@ var FontFactory = class {
|
|
|
229
226
|
}
|
|
230
227
|
static subsetFont(source, text) {
|
|
231
228
|
const buffer = toArrayBuffer(source);
|
|
232
|
-
const font = fontjs.Font.fromStream(
|
|
229
|
+
const font = fontjs.Font.fromStream(new bs.SeqStream({ stream: new bs.ByteStream({ buffer }) }));
|
|
233
230
|
const gids = this.getIndexes(font, text);
|
|
234
231
|
const glyphs = font.glyphs;
|
|
235
232
|
const yMax = [];
|
|
@@ -284,7 +281,7 @@ var FontFactory = class {
|
|
|
284
281
|
cmapLanguage: 0
|
|
285
282
|
});
|
|
286
283
|
const newFontStream = new bs.SeqStream();
|
|
287
|
-
newFont.toStream(
|
|
284
|
+
newFont.toStream(newFontStream);
|
|
288
285
|
return newFontStream.buffer;
|
|
289
286
|
}
|
|
290
287
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peculiar/pdf-font",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Font handling library for PDF document generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@peculiar/utils": "^4.1.0",
|
|
49
49
|
"bytestreamjs": "^3.0.0",
|
|
50
|
-
"fontjs": "^
|
|
50
|
+
"fontjs": "^4.0.0",
|
|
51
51
|
"pako": "^2.2.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|