Example #1
0
 public bool loadInternal()
 {
     _spriteFont            = _fileHandle.loadFromContentManager <SpriteFont>();
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.GetGlyphs()['A'].BoundsInTexture.Height;
     return(true);
 }
Example #2
0
 public MonoGameGameFont(MonoGameFileHandle fntFileHandle, MonoGameFileHandle textureFileHandle)
 {
     _fontName              = fntFileHandle.nameWithoutExtension();
     _spriteFont            = BMFontLoader.LoadXml(fntFileHandle.readString(), ((MonoGameTexture)Mdx.graphics.newTexture(textureFileHandle)).texture2D);
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
 }
Example #3
0
 public bool loadInternal()
 {
     _fontName              = _fileHandle.nameWithoutExtension();
     _spriteFont            = _fileHandle.loadFromContentManager <SpriteFont>();
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
     return(true);
 }
Example #4
0
 public MonoGameGameFont(MonoGameFileHandle ttfFileHandle, int size)
 {
     size++;
     _spriteFont = TtfFontBaker.Bake(ttfFileHandle.readBytesAsByteArray(),
                                     size,
                                     1024,
                                     1024,
                                     new[]
     {
         CharacterRange.BasicLatin,
         CharacterRange.Latin1Supplement,
         CharacterRange.LatinExtendedA,
         CharacterRange.Cyrillic
     }
                                     ).CreateSpriteFont(((MonoGameGraphics)Mdx.graphicsContext_)._graphicsDevice);
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.GetGlyphs()['A'].BoundsInTexture.Height;
 }
Example #5
0
 public MonoGameGameFont(MonoGameFileHandle ttfFileHandle, int size)
 {
     _fontName   = ttfFileHandle.nameWithoutExtension();
     _spriteFont = TtfFontBaker.Bake(ttfFileHandle.readBytes(),
                                     size,
                                     1024,
                                     1024,
                                     new[]
     {
         CharacterRange.BasicLatin,
         CharacterRange.Latin1Supplement,
         CharacterRange.LatinExtendedA,
         CharacterRange.Cyrillic
     }
                                     ).CreateSpriteFont(((MonoGameGraphics)Mdx.graphicsContext)._graphicsDevice);
     _sharedFontGlyphLayout = newGlyphLayout();
     _capHeight             = _spriteFont.MeasureString("A").Y;
 }