Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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" }
     });
 }
Exemplo n.º 3
0
        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);
        }