public GLFont(Font font, GLFontBuilderConfiguration config = null) { options = new GLFontRenderOptions(); if (config == null) { config = new GLFontBuilderConfiguration(); } fontData = new GLFontBuilder(font, config).BuildFontData(); }
public GLFont(string fileName, float size, GLFontBuilderConfiguration config, FontStyle style = FontStyle.Regular) { PrivateFontCollection pfc = new PrivateFontCollection(); pfc.AddFontFile(fileName); var fontFamily = pfc.Families[0]; if (!fontFamily.IsStyleAvailable(style)) { throw new ArgumentException("Font file: " + fileName + " does not support style: " + style); } if (config == null) { config = new GLFontBuilderConfiguration(); } using (var font = new Font(fontFamily, size * config.SuperSampleLevels, style)) { fontData = new GLFontBuilder(font, config).BuildFontData(); } pfc.Dispose(); }
public GLFontBuilder(Font font, GLFontBuilderConfiguration config) { this.charSet = config.CharSet; this.config = config; this.font = font; }