Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get detailed font metrics #1512

Open
Zedas74 opened this issue Apr 10, 2024 · 0 comments
Open

Get detailed font metrics #1512

Zedas74 opened this issue Apr 10, 2024 · 0 comments

Comments

@Zedas74
Copy link

Zedas74 commented Apr 10, 2024

Feature Request

Feature description

I would like to have more font metric information to render initials, etc. in form of a few getter functions.

The new methods should be placed after the currentLineHeight(includeGap) method in the pdfkit/lib/mixins/fonts.js file.

I already use them locally:

currentFontAscender() { return (this._font.ascender) / 1000 * this._fontSize; },
currentFontDescender() { return (this._font.descender) / 1000 * this._fontSize; },
currentFontLineGap() { return (this._font.lineGap) / 1000 * this._fontSize; },
currentFontXHeight() { return (this._font.xHeight) / 1000 * this._fontSize; },
currentFontCapHeight() { return (this._font.capHeight) / 1000 * this._fontSize; },
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

No branches or pull requests

1 participant