some cleanup

This commit is contained in:
2026-05-18 23:19:40 -05:00
parent 7167d98cb6
commit 221cfa5e9c
7 changed files with 765 additions and 764 deletions
+6 -8
View File
@@ -51,7 +51,7 @@ public static class FontFind
bool flag = false;
ImVector<ImFontPtr> fonts = io.Fonts.Fonts;
List<ImFontPtr> toRemove = new List<ImFontPtr>();
for (int i = 0; i < fonts.Size; i++)
{
ImFontPtr font = fonts[i];
@@ -61,13 +61,13 @@ public static class FontFind
flag = true;
}
}
foreach (ImFontPtr font in toRemove)
{
io.Fonts.RemoveFont(font);
Program.Logger.Log("Removed font: " + fontName);
}
return flag;
}
}
@@ -110,11 +110,9 @@ public static class FontFind
metrics.WinDescent = ReadS16Be(os2Offset + 76);
}
metrics.TypoLineHeight =
metrics.TypoAscender - metrics.TypoDescender + metrics.TypoLineGap;
metrics.TypoLineHeight = metrics.TypoAscender - metrics.TypoDescender + metrics.TypoLineGap;
metrics.WinLineHeight =
metrics.WinAscent + metrics.WinDescent;
metrics.WinLineHeight = metrics.WinAscent + metrics.WinDescent;
return metrics;
@@ -142,7 +140,7 @@ public static class FontFind
return new string(new char[] { c1, c2, c3, c4 });
}
}
public static int GetRecommendedPixelSize(FontMetrics metrics)
{
if (metrics.UnitsPerEm == 0 || metrics.TypoLineHeight == 0)