示例#1
0
文件: Font.cs 项目: 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());
                }
            }
        }
示例#2
0
 public int GlyphIsProvided(char Ch)
 {
     return(SDL_ttf.TTF_GlyphIsProvided(myPtr, Ch));
 }
示例#3
0
 public bool HasGlyph(UInt16 ch)
 {
     return(SDL_ttf.TTF_GlyphIsProvided(_sdlFont, ch) > 0);
 }