public static FontDef CreateSystemFont(string fontName) { FontDef fontDef = new FontDef(fontName); fontDef.SetFont(Style.Small, "Fonts/System/System Small.ttf", new string[] { fontName }); fontDef.SetFont(Style.Normal, "Fonts/System/System Normal.ttf", new string[] { fontName }); fontDef.SetFont(Style.Bold, "Fonts/System/System Normal Bold.ttf", new string[] { fontName + "Bold" }); return(fontDef); }
static void AddLucidaGrande() { s_SupportedFonts[FontDef.k_LucidaGrande] = FontDef.CreateFromResources(FontDef.k_LucidaGrande, new Dictionary <FontDef.Style, string> { { FontDef.Style.Small, "Fonts/Lucida Grande small.ttf" }, { FontDef.Style.Normal, "Fonts/Lucida Grande.ttf" }, { FontDef.Style.Bold, "Fonts/Lucida Grande Bold.ttf" } }); }
public static FontDef CreateFromResources(string fontName, Dictionary <Style, string> fonts) { FontDef fontDef = new FontDef(fontName); foreach (var font in fonts) { fontDef.SetFont(font.Key, font.Value); } return(fontDef); }