Skip to content

Commit 84ed811

Browse files
Gillibaldclaude
andcommitted
Note the halved loca offsets in the batch bounds reader
The short loca format stores every offset divided by two, which is why the batch reader doubles what it reads. LocaTable's single-glyph path already carries that note; the inline decode in the batch path did not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 76af266 commit 84ed811

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/Avalonia.Base/Media/Fonts/Tables/Glyf/GlyfTable.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public void GetGlyphBounds(ReadOnlySpan<ushort> glyphIndices, Span<GlyphBounds>
196196

197197
if (shortFormat)
198198
{
199+
// Short format: uint16 values stored divided by 2
199200
start = BinaryPrimitives.ReadUInt16BigEndian(loca.Slice(locaOffset)) * 2;
200201
end = BinaryPrimitives.ReadUInt16BigEndian(loca.Slice(locaOffset + 2)) * 2;
201202
}

0 commit comments

Comments
 (0)