public UIFont(IModHelper helper, string assetName, string id = "") { if (id == "") { id = assetName; } Id = id; FontFile = FontLoader.Parse(File.ReadAllText(Path.Combine(helper.DirectoryPath, assetName))); CharacterMap = new Dictionary <char, FontChar>(); foreach (FontChar fontChar in FontFile.Chars) { char cid = (char)fontChar.ID; CharacterMap.Add(cid, fontChar); } FontPages = new List <Texture2D>(); foreach (FontPage page in FontFile.Pages) { FontPages.Add(helper.Content.Load <Texture2D>(Path.Combine(Path.GetDirectoryName(assetName), page.File))); } }
public FontFile LoadFontFile(string assetName) { //return Plato.ModHelper.Content.Load<FontFile>(assetName);// return(FontLoader.Parse(File.ReadAllText(Path.Combine(Plato.ModHelper.DirectoryPath, assetName)))); }
private static FontFile LoadFont(string assetName) { return(FontLoader.Parse(Game1.content.Load <XmlSource>(assetName).Source)); }