コード例 #1
0
        public void ShouldSetNominalGlyphsDelegate()
        {
            using (var font = new Font(Font))
                using (var fontFuncs = new FontFunctions())
                {
                    fontFuncs.SetNominalGlyphsDelegate((_, __, c, u, g) =>
                    {
                        g[0] = 1337;
                        return(1);
                    });

                    fontFuncs.MakeImmutable();

                    font.SetFontFunctions(fontFuncs, "FontData");

                    var result = font.TryGetNominalGlyph(49, out var glyph);

                    Assert.True(result);
                    Assert.Equal(1337u, glyph);
                }
        }