Ejemplo n.º 1
0
Archivo: Font.cs Proyecto: xxami/Pulsus
        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());
                }
            }
        }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
            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);
            }