rendered paste bodyusing System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Text;
class Tests {
static void PrintFontDesc (Font font)
{
Console.WriteLine ("Name: {0}", font.Name);
Console.WriteLine ("Height: {0}", font.Height);
Console.WriteLine ("Size: {0}", font.Size);
Console.WriteLine ("SizeInPoints: {0}", font.SizeInPoints);
Console.WriteLine ("Style: {0}", font.Style);
Console.WriteLine ("Underline: {0}", font.Underline);
}
static void Main ()
{
Bitmap bmp = new Bitmap (20, 20);
Graphics g = Graphics.FromImage (bmp);
Console.WriteLine ("dpiX: {0} dpiY: {1}", g.DpiX, g.DpiY);
Font font = new Font (new FontFamily (GenericFontFamilies.Serif), 11);
PrintFontDesc (font);
SizeF size = g.MeasureString ("hola", font);
Console.WriteLine (size);
}
}
--------------
Mono:
dpiX: 96 dpiY: 96
Name: Times New Roman
Height: 17
Size: 11
SizeInPoints: 11
Style: Regular
Underline: False
{Width=26, Height=17}
----
MS:
dpiX: 96 dpiY: 96
Name: Times New Roman
Height: 17
Size: 11
SizeInPoints: 11
Style: Regular
Underline: False
{Width=30.8993, Height=18.07552}