mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-02 13:16:35 -05:00
Bugfix
This commit is contained in:
@@ -152,7 +152,11 @@ namespace HavenSoft.HexManiac.WPF.Implementations {
|
||||
var advanceWidths = new List<double>(text.Length);
|
||||
double totalWidth = 0;
|
||||
for (int i = 0; i < text.Length; i++) {
|
||||
ushort glyphIndex = typeface.CharacterToGlyphMap[text[i]];
|
||||
if (!typeface.CharacterToGlyphMap.TryGetValue(text[i], out ushort glyphIndex)) {
|
||||
text = text.Substring(0, i) + text.Substring(i + 1);
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
glyphIndexes.Add(glyphIndex);
|
||||
double width = typeface.AdvanceWidths[glyphIndex] * size;
|
||||
advanceWidths.Add(width);
|
||||
|
||||
Reference in New Issue
Block a user