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 @@ -379,18 +379,19 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c

GlyphShapingData current = substitutionCollection[i];
IndicShapingEngineInfo currentInfo = current.IndicShapingEngineInfo!;
glyphs[0] = current.GlyphId;
glyphs[1] = circleId;
glyphs[0] = circleId;
glyphs[1] = current.GlyphId;

substitutionCollection.Replace(i, glyphs, FeatureTags.GlyphCompositionDecomposition);

// Update shaping info for newly inserted data.
GlyphShapingData dotted = substitutionCollection[i + 1];
// The dotted circle is now at position i (inherits original shaping info).
// Update it to be a dotted circle base.
GlyphShapingData dotted = substitutionCollection[i];
dotted.IndicShapingEngineInfo!.Category = Categories.Dotted_Circle;
dotted.IndicShapingEngineInfo.Position = Positions.End;
dotted.IndicShapingEngineInfo.SyllableType = currentInfo.SyllableType;
dotted.IndicShapingEngineInfo.Syllable = currentInfo.Syllable;

// The original mark glyph is now at position i + 1 (copy of original info).
// Its shaping info is already correct from the copy.
end++;
max++;
}
Expand Down Expand Up @@ -705,6 +706,15 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c
}
else if (info.Position != Positions.SMVD)
{
// If an MPst follows an SM, update the SM's position to match
// so they move together during reordering.
if (info.Category == Categories.MPst
&& i > start
&& substitutionCollection[i - 1].IndicShapingEngineInfo?.Category == Categories.SM)
{
substitutionCollection[i - 1].IndicShapingEngineInfo!.Position = info.Position;
}

lastPosition = info.Position;
}
}
Expand Down Expand Up @@ -732,7 +742,7 @@ private void InitialReorder(IGlyphShapingCollection collection, int index, int c

last = i;
}
else if ((FlagUnsafe(info.Category) & Flag(Categories.M)) != 0)
else if ((FlagUnsafe(info.Category) & (Flag(Categories.M) | Flag(Categories.MPst))) != 0)
{
last = i;
}
Expand Down
Loading
Loading