Esempio n. 1
0
        public void ShouldSetGlyphFromNameDelegate()
        {
            using (var font = new Font(Font))
                using (var fontFuncs = new FontFunctions())
                {
                    fontFuncs.SetGlyphFromNameDelegate((Font f, object fd, string n, out uint g) =>
                    {
                        g = n[0];
                        return(true);
                    });

                    fontFuncs.MakeImmutable();

                    font.SetFontFunctions(fontFuncs, "FontData");

                    var result = font.TryGetGlyphFromName("H", out var glyph);

                    Assert.True(result);
                    Assert.Equal('H', glyph);
                }
        }