Exemple #1
0
 public void End()
 {
     CContext.Restore();
     ClearOperation = savedClear;
     StrokeColor    = savedStrokeColor;
     FillColor      = savedFillColor;
     fSlant         = savedFSlant;
     fWeight        = savedFWeight;
     fAlignment     = savedAlignment;
     LineWidth      = savedLineWidth;
     FontSize       = savedFontSize;
     FontFamily     = savedFontFamily;
     LineStyle      = savedLineStyle;
 }
Exemple #2
0
 public ContextStatus(Color strokeColor, Color fillColor, Style fSlant,
                      Weight fWeight, Pango.Alignment alignment, int lineWidth, int fontSize,
                      string fontFamily, LineStyle lineStyle, bool clear)
 {
     StrokeColor = strokeColor;
     FillColor   = fillColor;
     FSlant      = fSlant;
     FWeight     = fWeight;
     Alignment   = alignment;
     LineWidth   = lineWidth;
     FontSize    = fontSize;
     FontFamily  = fontFamily;
     LineStyle   = lineStyle;
     Clear       = clear;
 }
Exemple #3
0
        public void End()
        {
            CContext.Restore();
            ContextStatus cstatus = contextStatus.Pop();

            ClearOperation = cstatus.Clear;
            StrokeColor    = cstatus.StrokeColor;
            FillColor      = cstatus.FillColor;
            fSlant         = cstatus.FSlant;
            fWeight        = cstatus.FWeight;
            fAlignment     = cstatus.Alignment;
            LineWidth      = cstatus.LineWidth;
            FontSize       = cstatus.FontSize;
            FontFamily     = cstatus.FontFamily;
            LineStyle      = cstatus.LineStyle;
        }
Exemple #4
0
        private Gtk.Justification ConvertJustificaton()
        {
            Pango.Alignment alignment = ((MultiLineTextFigure)Figure).FontAlignment;

            switch (alignment)
            {
            case Pango.Alignment.Center:
                return(Gtk.Justification.Center);

            case Pango.Alignment.Left:
                return(Gtk.Justification.Left);

            case Pango.Alignment.Right:
                return(Gtk.Justification.Right);

            default:
                return(Gtk.Justification.Left);
            }
        }
Exemple #5
0
        // Shows a text from the current position. Defines all the line as text drawing box
        public void ShowPangoText(string str, bool bold, double width, double rotation)
        {
            Pango.Alignment align = layout.Alignment;

            if (bold)
            {
                layout.FontDescription.Weight = Pango.Weight.Bold;
            }

            if (width == -1)               // Calculates maximum width in the user space
            {
                layout.Width = (int)(((1 - width_margin) * Matrix.Xx - (CurrentPoint.X * Matrix.Xx)) * Pango.Scale.PangoScale);
            }
            else
            {
                layout.Width = (int)(width * Matrix.Xx * Pango.Scale.PangoScale);
            }

            if (rotation != 0)
            {
                Cairo.Matrix old = Matrix;

                UpdateFontSize();
                Matrix = new Cairo.Matrix();
                Rotate(rotation);
                SetText(str);
                layout.SingleParagraphMode = true;

                Pango.CairoHelper.ShowLayout(this, layout);
                Matrix = old;
            }
            else
            {
                ShowPangoText(str);
            }

            layout.FontDescription.Weight = Pango.Weight.Normal;
            layout.Alignment = align;
        }