Exemple #1
0
        /// <summary>
        /// Gets the Kerning Value between two Unicode characters at the Font Size, or 0 if there is no Kerning
        /// </summary>
        public float GetKerning(char unicode0, char unicode1)
        {
            if (Charset.TryGetValue(unicode0, out var char0) && Charset.TryGetValue(unicode1, out var char1))
            {
                if (Font.Disposed)
                {
                    throw new Exception("Cannot get Font data as it is disposed");
                }

                return(StbTrueType.stbtt_GetGlyphKernAdvance(Font.fontInfo, char0.Glyph, char1.Glyph) * Scale);
            }

            return(0f);
        }
Exemple #2
0
 public static int __tt_getGlyphKernAdvance(this StbTrueType.stbtt_fontinfo font, int glyph1, int glyph2)
 {
     return((int)(StbTrueType.stbtt_GetGlyphKernAdvance(font, (int)(glyph1), (int)(glyph2))));
 }