private DynamicSpriteFont(byte[] ttf, int defaultSize, int textureWidth, int textureHeight, int blur)
        {
            _fontSystem = new FontSystem(textureWidth, textureHeight, blur)
            {
                FontSize = defaultSize
            };

            _fontSystem.AddFontMem(ttf);
        }
        DynamicSpriteFont(GraphicsDevice graphicsDevice, byte[] ttf, int defaultSize, int textureWidth, int textureHeight, int blur, int stroke)
        {
            var textureCreator = new Texture2DCreator(graphicsDevice);

            _fontSystem = new FontSystem(StbTrueTypeSharpFontLoader.Instance, textureCreator, textureWidth, textureHeight, blur, stroke)
            {
                FontSize = defaultSize
            };

            _fontSystem.AddFontMem(ttf);
        }
Пример #3
0
        private DynamicSpriteFont(byte[] ttf, float defaultSize, int textureWidth, int textureHeight)
        {
            var fontParams = new FontSystemParams
            {
                Width              = textureWidth,
                Height             = textureHeight,
                IsAlignmentTopLeft = true
            };

            _fontSystem           = new FontSystem(fontParams);
            _fontSystem.Alignment = Alignment.Top;

            _defaultFontId = _fontSystem.AddFontMem(DefaultFontName, ttf);
            Size           = defaultSize;
        }
Пример #4
0
        private DynamicSpriteFont(byte[] ttf, float defaultSize, int textureWidth, int textureHeight)
        {
            var fontParams = new FontSystemParams
            {
                Width  = textureWidth,
                Height = textureHeight,
                Flags  = FontSystem.FONS_ZERO_TOPLEFT
            };

            _fontSystem           = new FontSystem(fontParams);
            _fontSystem.Alignment = FontSystem.FONS_ALIGN_TOP;

            _defaultFontId = _fontSystem.AddFontMem(DefaultFontName, ttf);
            Size           = defaultSize;
        }
 public void AddTtf(byte[] ttf)
 {
     _fontSystem.AddFontMem(ttf);
 }
Пример #6
0
 public int AddTtf(string name, byte[] ttf)
 {
     return(_fontSystem.AddFontMem(name, ttf));
 }