public static StbTrueTypeNativeSource FromMemory(byte[] data, FontSystemSettings settings)
        {
            var font = new StbTrueTypeNativeSource(data, settings);

            int ascent, descent, lineGap;

            font._font.GetFontVMetrics(out ascent, out descent, out lineGap);

            var fh = ascent - descent;

            font.AscentBase     = ascent / (float)fh;
            font.DescentBase    = descent / (float)fh;
            font.LineHeightBase = (fh + lineGap) / (float)fh;

            return(font);
        }
Exemple #2
0
 public IFontSource Load(byte[] data, FontSystemSettings settings)
 {
     return(StbTrueTypeNativeSource.FromMemory(data, settings));
 }