示例#1
0
 public void SetItalic(bool italic)
 {
     if (italic)
     {
         this.style = Pango.Style.Italic;
     }
     else
     {
         this.style = Pango.Style.Normal;
     }
 }
示例#2
0
        public static bool ParseStyle(string str, out Pango.Style style, bool warn)
        {
            IntPtr native_str = GLib.Marshaller.StringToPtrGStrdup(str);
            int    native_style;
            bool   raw_ret = pango_parse_style(native_str, out native_style, warn);
            bool   ret     = raw_ret;

            GLib.Marshaller.Free(native_str);
            style = (Pango.Style)native_style;
            return(ret);
        }
示例#3
0
        // Pango Style sounds like some sort of dance
        private static FontStyle FromPangoStyle(Pango.Style pangoStyle, Pango.Weight pangoWeight)
        {
            FontStyle result = FontStyle.Regular;

            if (pangoWeight == Pango.Weight.Bold)
            {
                result |= FontStyle.Bold;
            }

            if (pangoStyle == Pango.Style.Italic)
            {
                result |= FontStyle.Italic;
            }

            return(FontStyle.Regular);
        }
示例#4
0
 public AttrStyle(Pango.Style style) : this(pango_attr_style_new(style))
 {
 }
示例#5
0
 static extern IntPtr pango_attr_style_new(Pango.Style style);
示例#6
0
 public void AddStyleAttribute(Pango.Style style, uint start, uint end)
 {
     Add(pango_attr_style_new(style), start, end);
 }
示例#7
0
 public Pango.Style GetStyle(Pango.Style defaultStyle)
 {
     return(Italic ? Pango.Style.Italic : Pango.Style.Normal);
 }
示例#8
0
 public void SetItalic(bool italic)
 {
     if (italic)
         this.style = Pango.Style.Italic;
     else
         this.style = Pango.Style.Normal;
 }