Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,19 @@ public static void ApplyAnchor(
FontMetrics fontMetrics,
GlyphPositioningCollection collection,
int index,
AnchorTable baseAnchor,
AnchorTable? baseAnchor,
MarkRecord markRecord,
int baseGlyphIndex,
Tag feature)
{
// baseAnchor may be null because OpenType MarkToBase allows NULL anchor offsets
// in BaseArray/BaseRecord. A NULL offset means "this base glyph has no anchor
// for this mark class", and the lookup must be ignored for this mark–base pair.
if (baseAnchor is null)
{
return;
}

GlyphShapingData baseData = collection[baseGlyphIndex];
AnchorXY baseXY = baseAnchor.GetAnchor(fontMetrics, baseData, collection);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public static LookupType4Format1SubTable Load(BigEndianBinaryReader reader, long
ushort markArrayOffset = reader.ReadOffset16();
ushort baseArrayOffset = reader.ReadOffset16();

var markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset);
var baseCoverage = CoverageTable.Load(reader, offset + baseCoverageOffset);
var markArrayTable = new MarkArrayTable(reader, offset + markArrayOffset);
var baseArrayTable = new BaseArrayTable(reader, offset + baseArrayOffset, markClassCount);
CoverageTable markCoverage = CoverageTable.Load(reader, offset + markCoverageOffset);
CoverageTable baseCoverage = CoverageTable.Load(reader, offset + baseCoverageOffset);
MarkArrayTable markArrayTable = new(reader, offset + markArrayOffset);
BaseArrayTable baseArrayTable = new(reader, offset + baseArrayOffset, markClassCount);

return new LookupType4Format1SubTable(markCoverage, baseCoverage, markArrayTable, baseArrayTable, lookupFlags);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public override bool TryUpdatePosition(
while (--baseGlyphIndex >= 0)
{
GlyphShapingData data = collection[baseGlyphIndex];
if (!AdvancedTypographicUtils.IsMarkGlyph(fontMetrics, data.GlyphId, data) && !(data.LigatureComponent > 0))
if (!AdvancedTypographicUtils.IsMarkGlyph(fontMetrics, data.GlyphId, data) && data.LigatureComponent <= 0)
{
break;
}
Expand Down
Loading