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; }
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; }
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; }
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); } }
// 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; }