예제 #1
0
        public void ShouldSetGlyphContourPointDelegate()
        {
            using (var font = new Font(Font))
                using (var fontFuncs = new FontFunctions())
                {
                    var expected = 1337;

                    fontFuncs.SetGlyphContourPointDelegate((Font f, object fd, uint g, uint p, out int px, out int py) =>
                    {
                        px = expected;
                        py = expected;
                        return(true);
                    });

                    fontFuncs.MakeImmutable();

                    font.SetFontFunctions(fontFuncs, "FontData");

                    var result = font.TryGetGlyphContourPoint('H', 0, out var x, out var y);

                    Assert.True(result);
                    Assert.Equal(expected, x);
                }
        }