1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-24 09:08:07 +02:00

Merge pull request #19548 from Snuffleupagus/Font-exportData-disableFontFace-fontExtraProperties

Send `disableFontFace` and `fontExtraProperties` as part of the exported font-data
This commit is contained in:
Jonas Jenwald 2025-02-26 11:25:29 +01:00 committed by GitHub
commit da17c7b82f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 132 additions and 115 deletions

View file

@ -16,17 +16,22 @@ describe("font_fpgm", function () {
const cMap = await CMapFactory.create({
encoding: Name.get("Identity-H"),
});
const font = new Font("font", new Stream(font2324), {
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font2324),
{
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);

View file

@ -17,16 +17,21 @@ describe("font_post", function () {
describe("OS/2 table removal on bad post table values", function () {
it("has invalid version number", async function () {
const font = new Font("font", new Stream(font2154), {
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font2154),
{
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);
@ -39,17 +44,22 @@ describe("font_post", function () {
const cMap = await CMapFactory.create({
encoding: Name.get("Identity-H"),
});
const font = new Font("font", new Stream(font1282), {
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font1282),
{
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);

View file

@ -24,17 +24,22 @@ describe("font_post", function () {
const cMap = await CMapFactory.create({
encoding: Name.get("Identity-H"),
});
const font = new Font("font", new Stream(font2109), {
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font2109),
{
loadedName: "font",
type: "CIDFontType2",
differences: [],
defaultEncoding: [],
cMap,
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);
@ -42,16 +47,21 @@ describe("font_post", function () {
});
it("has invalid glyph name indexes", async function () {
const font = new Font("font", new Stream(font2189), {
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font2189),
{
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);
@ -59,16 +69,21 @@ describe("font_post", function () {
});
it("has right amount of glyphs specified", async function () {
const font = new Font("font", new Stream(font2374), {
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
});
const font = new Font(
"font",
new Stream(font2374),
{
loadedName: "font",
type: "TrueType",
differences: [],
defaultEncoding: [],
toUnicode: new ToUnicodeMap([]),
xHeight: 0,
capHeight: 0,
italicAngle: 0,
},
{}
);
const output = await ttx(font.data);
verifyTtxOutput(output);