Exemplo n.º 1
0
Arquivo: Font.cs Projeto: 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());
                }
            }
        }
Exemplo n.º 2
0
 public int GlyphIsProvided(char Ch)
 {
     return(SDL_ttf.TTF_GlyphIsProvided(myPtr, Ch));
 }
Exemplo n.º 3
0
 public bool HasGlyph(UInt16 ch)
 {
     return(SDL_ttf.TTF_GlyphIsProvided(_sdlFont, ch) > 0);
 }