public FontManager() { families = new List <FontFamily> (); using (Pango.Context c = PangoHelper.ContextGet()) families.AddRange(c.Families); }
private int GetTextPixelLength(string text, string font) { int width, height; Screen screen = Screen.Default; Pango.Layout layout = new Pango.Layout(PangoHelper.ContextGetForScreen(screen)); layout.FontDescription = Pango.FontDescription.FromString(font); layout.SetText(text); layout.GetPixelSize(out width, out height); return(width); }