Пример #1
0
 public void ImmutableFunctionsShouldNotChange()
 {
     using (var fontFuncs = new FontFunctions())
     {
         fontFuncs.MakeImmutable();
         Assert.Throws <InvalidOperationException>(() => fontFuncs.SetHorizontalGlyphAdvanceDelegate((a, b, c) => 1337));
     }
 }
Пример #2
0
        public void ShouldSetHorizontalGlyphAdvanceDelegate()
        {
            using (var font = new Font(Font))
                using (var fontFuncs = new FontFunctions())
                {
                    fontFuncs.SetHorizontalGlyphAdvanceDelegate((f, fd, g) => 1337);

                    fontFuncs.MakeImmutable();

                    font.SetFontFunctions(fontFuncs, "FontData");

                    var advance = font.GetHorizontalGlyphAdvance(49);

                    Assert.Equal(1337, advance);
                }
        }