Ejemplo n.º 1
0
        public int ListFamilies(Pango.FontFamily families)
        {
            int n_families;

            pango_font_map_list_families(Handle, families.Handle, out n_families);
            return(n_families);
        }
Ejemplo n.º 2
0
        private void RenderCellFamilyName(Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            Pango.FontFamily family = model.GetValue(iter, 1) as Pango.FontFamily;
            (cell as Gtk.CellRendererText).Text = family.Name;

            Pango.FontDescription desc = new Pango.FontDescription();
            desc.Family = family.Name;
            desc.Size   = (int)(FontTool.FontService.FONT_DEFAULT_SIZE * Pango.Scale.PangoScale);

            (cell as Gtk.CellRendererText).FontDesc = desc;
        }
Ejemplo n.º 3
0
        public static Pango.FontFace FindFontFace(Pango.FontDescription desc, Pango.FontFamily family = null)
        {
            if (family == null)
            {
                family = FontFamilyHandler.FindCorrectedFamily(desc.Family);
            }
            var weight  = desc.Weight;
            var style   = desc.Style;
            var stretch = desc.Stretch;

            foreach (var face in family.Faces)
            {
                var faceDesc = face.Describe();
                if (faceDesc.Weight == weight && faceDesc.Style == style && faceDesc.Stretch == stretch)
                {
                    return(face);
                }
            }
            return(null);
        }
Ejemplo n.º 4
0
        bool InvokeNative(Pango.FontFamily family, Pango.FontFace face)
        {
            bool __result = native_cb(family == null ? IntPtr.Zero : family.Handle, face == null ? IntPtr.Zero : face.Handle, __data);

            return(__result);
        }