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
        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);
        }