Ejemplo n.º 1
0
        public void Font_GetOverhangPadding(string family, float size, float expected)
        {
            using Font font = new Font(family, size);
            if (font.Name != family)
            {
                // Not installed on this machine
                return;
            }

            using WindowsFont windowsFont = WindowsFont.FromFont(font, Gdi32.QUALITY.CLEARTYPE);
            WindowsGraphics graphics = WindowsGraphicsCacheManager.MeasurementGraphics;

            Assert.Equal(expected, graphics.GetOverhangPadding(windowsFont));
        }