Support Type3 fonts with an incomplete /FontDescriptor dictionary (issue 19954)
We have a fallback for the common case of Type3 fonts without a /FontDescriptor dictionary, however we also need to handle the case where it's present but lacking the required /FontName entry.
This commit is contained in:
parent
819671d42f
commit
5f5d9dfc28
@ -4420,7 +4420,13 @@ class PartialEvaluator {
|
|||||||
|
|
||||||
const fontNameStr = fontName?.name;
|
const fontNameStr = fontName?.name;
|
||||||
const baseFontStr = baseFont?.name;
|
const baseFontStr = baseFont?.name;
|
||||||
if (!isType3Font && fontNameStr !== baseFontStr) {
|
if (isType3Font) {
|
||||||
|
if (!fontNameStr) {
|
||||||
|
// The Type3 font has a /FontDescriptor, however it's incomplete, hence
|
||||||
|
// why we didn't create a barbebones one above (fixes issue19954.pdf).
|
||||||
|
fontName = Name.get(type);
|
||||||
|
}
|
||||||
|
} else if (fontNameStr !== baseFontStr) {
|
||||||
info(
|
info(
|
||||||
`The FontDescriptor's FontName is "${fontNameStr}" but ` +
|
`The FontDescriptor's FontName is "${fontNameStr}" but ` +
|
||||||
`should be the same as the Font's BaseFont "${baseFontStr}".`
|
`should be the same as the Font's BaseFont "${baseFontStr}".`
|
||||||
|
|||||||
1
test/pdfs/issue19954.pdf.link
Normal file
1
test/pdfs/issue19954.pdf.link
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/user-attachments/files/20281525/Capital.Bancorp.Inc.Corporate.Responsibility.2025509.SD000000003063823863-1-2.pdf
|
||||||
@ -2859,6 +2859,15 @@
|
|||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "issue19954",
|
||||||
|
"file": "pdfs/issue19954.pdf",
|
||||||
|
"md5": "9742309bb321691b53b96069dfc1099b",
|
||||||
|
"link": true,
|
||||||
|
"rounds": 1,
|
||||||
|
"lastPage": 1,
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "IndexedCS_negative_and_high",
|
"id": "IndexedCS_negative_and_high",
|
||||||
"file": "pdfs/IndexedCS_negative_and_high.pdf",
|
"file": "pdfs/IndexedCS_negative_and_high.pdf",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user