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

Add mandatory absFontCallback entries for caretoff calculation #1771

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions c/addfeatures/hotconv/hmtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ static int caretoffBeg(abfGlyphCallbacks *cb, abfGlyphInfo *info) {
return ABF_CONT_RET;
}

static void caretoffWidth(abfGlyphCallbacks *cb, float hAdv) {
}

/* [cffread path callback] Add moveto to path */
static void caretoffMoveto(abfGlyphCallbacks *cb, float x1, float y1) {
checkPoint((costate *) cb->direct_ctx, x1, y1);
Expand All @@ -208,6 +211,9 @@ static void caretoffCurveto(abfGlyphCallbacks *cb, float x1, float y1,
checkPoint((costate *) cb->direct_ctx, x3, y3);
}

static void caretoffEnd(abfGlyphCallbacks *cb) {
}

/* Calculate caret offset for an italic font. Shear heuristic glyph upright,
calculate its left (a) and right (b) side-bearings. Return a-(a+b)/2 */
static short calcCaretOffset(hotCtx g) {
Expand All @@ -222,15 +228,15 @@ static short calcCaretOffset(hotCtx g) {
NULL,
NULL,
caretoffBeg,
NULL,
caretoffWidth,
caretoffMoveto,
caretoffLineto,
caretoffCurveto,
NULL,
NULL,
NULL,
NULL,
NULL,
caretoffEnd,
NULL,
NULL,
NULL
Expand Down
Loading