Skip to content

Commit

Permalink
XML output includes width of digit '0' if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim committed Nov 23, 2021
1 parent 3fe11a2 commit 5b35ee3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions FontGenerator/FileGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class FileGenerator
const string StrDefineChar = "DEFINE_CHAR";

const string StrXmlFont = "<Font Name='{0}' FontFamily='{1}' FontStyle='{2}' FontWeight='{3}' FontStretch='{4}' FontSize='{5}'/>";
const string StrXmlSize = "<Set>{0}_Height = {1}</Set>";
const string StrXmlHeight = "<Set>{0}_Height = {1}</Set>";
const string StrXmlWidth = "<Set>{0}_WidthZero = {1}</Set>";

StreamWriter Writer;
FileStream Stream;
Expand Down Expand Up @@ -153,7 +154,9 @@ public void WriteFont(FontBits fontBits)

font = fontBits.font;
Xml.WriteLine(StrXmlFont, fontBits.name, font.FontFamily, font.FontStyle, font.FontWeight, font.FontStretch, font.FontSize);
Xml.WriteLine(StrXmlSize, fontBits.name, fontBits.height);
Xml.WriteLine(StrXmlHeight, fontBits.name, fontBits.height);
if (fontBits.chFirst <= '0' && fontBits.chFirst + fontBits.cntChar > '0')
Xml.WriteLine(StrXmlWidth, fontBits.name, fontBits.arWidth['0' - fontBits.chFirst]);
}
}

Expand Down

0 comments on commit 5b35ee3

Please sign in to comment.