Skip to content

Commit

Permalink
Add mandatory entries to absFontCallbacks for caretoff calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
skef committed Jan 7, 2025
1 parent d125bc9 commit a1c9b0f
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit a1c9b0f

Please sign in to comment.