some cleanup
This commit is contained in:
+6
-8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user