Exemplo n.º 1
0
 /// <summary>
 /// Prepares the FontSet system.
 /// </summary>
 public static void Init()
 {
     Standard = new FontSet("standard");
     Standard.Load(GLFont.Standard.Name, GLFont.Standard.Size);
     Fonts.Add(Standard);
     SlightlyBigger = new FontSet("slightlybigger");
     SlightlyBigger.Load(GLFont.Standard.Name, GLFont.Standard.Size + 5);
     Fonts.Add(SlightlyBigger);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets a font by a specified name.
        /// </summary>
        /// <param name="fontname">The name of the font</param>
        /// <param name="fontsize">The size of the font</param>
        /// <returns>The specified font</returns>
        public static FontSet GetFont(string fontname, int fontsize)
        {
            string namelow = fontname.ToLower();

            for (int i = 0; i < Fonts.Count; i++)
            {
                if (Fonts[i].font_default.Size == fontsize && Fonts[i].Name == namelow)
                {
                    return(Fonts[i]);
                }
            }
            FontSet toret = new FontSet(fontname);

            toret.Load(fontname, fontsize);
            Fonts.Add(toret);
            return(toret);
        }