I have simple application that prints text and determines its size in pixels.
static void Main(string[] args)
{
Application.Init();
var screen = Screen.Default;
var layout = new Pango.Layout(PangoHelper.ContextGetForScreen(screen));
layout.FontDescription = new FontDescription();
layout.FontDescription.Family = "Times New Roman";
layout.FontDescription.Size = Units.FromPixels(18);
layout.SetText("My Text");
int width;
int height;
layout.GetPixelSize(out width, out height);
Console.WriteLine("{0} - width:{1} height:{2}", layout.Text, width, height);
Console.ReadLine();
}
But I want to use my own font. How I can load my own font from file and use it in Pango in Mono?