Skip to content

Return list of fonts#24

Open
Elizavetaseluykovich wants to merge 1 commit intocustomizations-for-tagged-pdffrom
fonts-pop-up
Open

Return list of fonts#24
Elizavetaseluykovich wants to merge 1 commit intocustomizations-for-tagged-pdffrom
fonts-pop-up

Conversation

@Elizavetaseluykovich
Copy link
Copy Markdown

@Elizavetaseluykovich Elizavetaseluykovich commented Apr 27, 2026

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13007e66-2847-4e64-a932-2d124c83b7e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fonts-pop-up

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Vladimir-Burshnev Vladimir-Burshnev self-requested a review April 27, 2026 06:36
Comment thread src/core/catalog.js
Comment on lines +2002 to +2008
const subtypeStr =
// eslint-disable-next-line no-nested-ternary
subtype instanceof Name
? subtype.name
: typeof subtype === "string"
? subtype
: null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar getters for names or strings are used in several other places, so it's better to move this logic into a separate function.

Comment thread src/core/catalog.js
Comment on lines +2140 to +2168
if (fontObj.has("BaseFont")) {
const baseFont = fontObj.get("BaseFont");
if (baseFont instanceof Name) {
fontInfo.baseFont = baseFont.name;
} else if (typeof baseFont === "string") {
fontInfo.baseFont = baseFont;
}
}

if (fontObj.has("Encoding")) {
const encoding = fontObj.get("Encoding");
if (encoding instanceof Name) {
fontInfo.encoding = encoding.name;
} else if (typeof encoding === "string") {
fontInfo.encoding = encoding;
}
}

if (descriptor instanceof Dict) {
const fontFile =
descriptor.get("FontFile") ||
descriptor.get("FontFile2") ||
descriptor.get("FontFile3");
fontInfo.isEmbedded = !!fontFile;
}

fontInfo.isSubset = fontInfo.baseFont
? /^[A-Z0-9]{1,6}\+/.test(fontInfo.baseFont)
: false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why this can't be calculated directly in resolveFontInfo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants