Пример #1
0
        private static FontSystem InternalCreate(GraphicsDevice graphicsDevice, int textureWidth, int textureHeight, int blurAmount, int strokeAmount, bool premultiplyAlpha)
        {
            var textureCreator = new Texture2DCreator(graphicsDevice);
            var result         = new FontSystem(StbTrueTypeSharpFontLoader.Instance, textureCreator, textureWidth, textureHeight, blurAmount, strokeAmount, premultiplyAlpha);

            return(result);
        }
Пример #2
0
        private FontSystem LoadFont(int blur, int stroke)
        {
            var fontLoader     = StbTrueTypeSharpFontLoader.Instance;
            var textureCreator = new Texture2DCreator(GraphicsDevice);

            var result = new FontSystem(fontLoader, textureCreator, 1024, 1024, blur, stroke);

            result.AddFont(File.ReadAllBytes(@"Fonts/DroidSans.ttf"));
            result.AddFont(File.ReadAllBytes(@"Fonts/DroidSansJapanese.ttf"));
            result.AddFont(File.ReadAllBytes(@"Fonts/Symbola-Emoji.ttf"));

            return(result);
        }