public void ShouldSetGlyphExtentsDelegate() { using (var font = new Font(Font)) using (var fontFuncs = new FontFunctions()) { var expected = new GlyphExtents { Height = 1337 }; fontFuncs.SetGlyphExtentsDelegate((Font f, object fd, uint g, out GlyphExtents e) => { e = expected; return(true); }); fontFuncs.MakeImmutable(); font.SetFontFunctions(fontFuncs, "FontData"); var result = font.TryGetGlyphExtents('H', out var extents); Assert.True(result); Assert.Equal(expected, extents); } }