Exemplo n.º 1
0
        public void Init()
        {
            ff = new Font("times");

            ff.AddFontSurface(new FontSettings(8, FontStyles.None),
                              FontSurface.FromImpl(new FakeFontSurface()
            {
                Height = 8
            }));

            ff.AddFontSurface(new FontSettings(8, FontStyles.Bold),
                              FontSurface.FromImpl(new FakeFontSurface {
                Height = 8
            }));

            ff.AddFontSurface(new FontSettings(10, FontStyles.None),
                              FontSurface.FromImpl(new FakeFontSurface {
                Height = 10
            }));

            ff.AddFontSurface(new FontSettings(10, FontStyles.Bold),
                              FontSurface.FromImpl(new FakeFontSurface {
                Height = 10
            }));
        }
Exemplo n.º 2
0
        private FontSurface ConstructUnkernedFont(FontSurface font)
        {
            var bmp = font.Impl as AgateLib.DisplayLib.BitmapFont.BitmapFontImpl;

            FontMetrics metrics = bmp.FontMetrics.Clone();

            foreach (var glyph in metrics.Keys)
            {
                metrics[glyph].KerningPairs.Clear();
            }

            return(FontSurface.FromImpl(new BitmapFontImpl(bmp.Surface, metrics, "Unkerned " + bmp.FontName)));
        }