/// <summary> /// Prepares the FontSet system. /// </summary> public void Init(Client tclient) { TheClient = tclient; Standard = new FontSet("standard", this); Standard.Load(GLFonts.Standard.Name, GLFonts.Standard.Size); Fonts.Add(Standard); SlightlyBigger = new FontSet("slightlybigger", this); SlightlyBigger.Load(GLFonts.Standard.Name, GLFonts.Standard.Size + 5); Fonts.Add(SlightlyBigger); }
/// <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 FontSet GetFont(string fontname, int fontsize) { string namelow = fontname.ToLowerFast(); 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, this); toret.Load(fontname, fontsize); Fonts.Add(toret); return(toret); }
/// <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 FontSet GetFont(string fontname, int fontsize) { string namelow = fontname.ToLowerFast(); 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, this); toret.Load(fontname, fontsize); Fonts.Add(toret); return toret; }