(string FilePath)
| 1182 | } |
| 1183 | |
| 1184 | public void SaveTo(string FilePath) |
| 1185 | { |
| 1186 | XmlDocument tDoc = new XmlDocument(); |
| 1187 | |
| 1188 | XmlElement tRoot = tDoc.CreateElement("FontDef"); |
| 1189 | tRoot.SetAttribute("TexWidth", TexWidth.ToString()); |
| 1190 | tRoot.SetAttribute("TexHeight", TexHeight.ToString()); |
| 1191 | tRoot.SetAttribute("AntiAlias", ((int)AntiAlias).ToString()); |
| 1192 | |
| 1193 | foreach (FontDef.CharDef x in _CharList) |
| 1194 | { |
| 1195 | XmlElement tElement = tDoc.CreateElement("Char"); |
| 1196 | |
| 1197 | tElement.SetAttribute("Advance", x.Advance.ToString()); |
| 1198 | tElement.SetAttribute("Baseline", x.Baseline.ToString()); |
| 1199 | tElement.SetAttribute("Character", x.Character.ToString()); |
| 1200 | tElement.SetAttribute("ImageMargin", x.ImageMargin.ToString()); |
| 1201 | tElement.SetAttribute("FontColor", x.FontColor.ToArgb().ToString()); |
| 1202 | |
| 1203 | if (x.SrcFont != null) |
| 1204 | { |
| 1205 | tElement.SetAttribute("Bold", x.SrcFont.Bold.ToString()); |
| 1206 | tElement.SetAttribute("Italic", x.SrcFont.Italic.ToString()); |
| 1207 | tElement.SetAttribute("Strikeout", x.SrcFont.Strikeout.ToString()); |
| 1208 | tElement.SetAttribute("Underline", x.SrcFont.Underline.ToString()); |
| 1209 | tElement.SetAttribute("FontName", x.SrcFont.FontFamily.Name); |
| 1210 | tElement.SetAttribute("FontSize", x.SrcFont.Size.ToString()); |
| 1211 | } |
| 1212 | else |
| 1213 | { |
| 1214 | tElement.SetAttribute("Bold", "False"); |
| 1215 | tElement.SetAttribute("Italic", "False"); |
| 1216 | tElement.SetAttribute("Strikeout", "False"); |
| 1217 | tElement.SetAttribute("Underline", "False"); |
| 1218 | tElement.SetAttribute("FontName", "宋体"); |
| 1219 | tElement.SetAttribute("FontSize", "12"); |
| 1220 | } |
| 1221 | |
| 1222 | tRoot.AppendChild(tElement); |
| 1223 | } |
| 1224 | |
| 1225 | tDoc.AppendChild(tRoot); |
| 1226 | |
| 1227 | tDoc.Save(FilePath); |
| 1228 | } |
| 1229 | |
| 1230 | public FontDef() |
| 1231 | { |
no outgoing calls
no test coverage detected