Why is y_offset 0 in my harfbuzz shaping example?

227 views Asked by At

I am using harfbuzz for transforming diacritical characters in my program. I have two characters "C" unicode 0043 and a diacritical symbol ̆ unicode 0306 in the font "Bahnschrift.ttf". I try to get the X and Y offsets. X looks good but y_offset makes no sense. I will explain why: The anker point which both characters have is called "t.uni0308_02". At "C" it has the position x:658; y:1454. At the diacritic it is at x:-367; y:1038. Here is the proof: Both characters in FontLab The result of hb_shape says: .\hb-shape.exe .\bahnschrift.ttf --output-format=json --unicodes="0043 0306"

[{"g":"C","cl":0,"dx":0,"dy":0,"ax":1267,"ay":0},{"g":"uni0306.case","cl":0,"dx":-182,"dy":0,"ax":0,"ay":0}]

Like there is no offset in the vertical. But when I draw the combination of this to characters with hb_view then it looks right. What is the point here? Am I missing something?

1

There are 1 answers

0
Sergej Neumann On

I found the solution. Harfbuzz realises that the diacritical glyph that i want to combine with the C is for small "c" and so it delivers the matching Glyph ID for "uni0306.case". For this glyph the Offset is right.