private void GenerateGlyphData(ushort characterCount) { Log.Info("Font: Generating glyph data for {0} characters", characterCount); glyphs = new FontGlyph[characterCount]; for (ushort i = 0; i < characterCount; ++i) { if (SDL_ttf.TTF_GlyphIsProvided(handle, i) == 0) { continue; } if (SDL_ttf.TTF_GlyphMetrics(handle, i, out glyphs[i].minX, out glyphs[i].maxX, out glyphs[i].minY, out glyphs[i].maxY, out glyphs[i].advance) != 0) { throw new ApplicationException("Failed to get glyph metrics for glyph " + i + " : " + SDL.SDL_GetError()); } } }
public void GlyphMetrcs(char Ch, out int Minx, out int Minxx, out int Miny, out int Maxy, out int Advance) { Util.ThrowIfResultIsError(SDL_ttf.TTF_GlyphMetrics(myPtr, Ch, out Minx, out Minxx, out Miny, out Maxy, out Advance)); }
public GlyphMetrics Metric(UInt16 ch) { int minX, minY, maxX, maxY, advance; return(SDL_ttf.TTF_GlyphMetrics(_sdlFont, ch, out minX, out maxX, out minY, out maxY, out advance) == 0 ? new GlyphMetrics(minX, maxX, minY, maxY, advance) : null); }