Ejemplo n.º 1
0
        public FontManager()
        {
            families = new List <FontFamily> ();

            using (Pango.Context c = PangoHelper.ContextGet())
                families.AddRange(c.Families);
        }
Ejemplo n.º 2
0
        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);
        }