From a1c9b0f84d546b389baf201f3d3b0b31dc24abdd Mon Sep 17 00:00:00 2001 From: Skef Iterum Date: Mon, 6 Jan 2025 16:10:34 -0800 Subject: [PATCH] Add mandatory entries to absFontCallbacks for caretoff calculation --- c/addfeatures/hotconv/hmtx.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/c/addfeatures/hotconv/hmtx.cpp b/c/addfeatures/hotconv/hmtx.cpp index 010fd4ea7..56f8543ea 100644 --- a/c/addfeatures/hotconv/hmtx.cpp +++ b/c/addfeatures/hotconv/hmtx.cpp @@ -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); @@ -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) { @@ -222,7 +228,7 @@ static short calcCaretOffset(hotCtx g) { NULL, NULL, caretoffBeg, - NULL, + caretoffWidth, caretoffMoveto, caretoffLineto, caretoffCurveto, @@ -230,7 +236,7 @@ static short calcCaretOffset(hotCtx g) { NULL, NULL, NULL, - NULL, + caretoffEnd, NULL, NULL, NULL