protected internal override void OptionsChanged ()
{
DisposeGCs ();
selectionColor = null;
currentLineColor = null;
var markerFont = textEditor.Options.Font.Copy ();
markerFont.Size = markerFont.Size * 8 / 10;
markerLayout.FontDescription = markerFont;
markerLayout.FontDescription.Weight = Pango.Weight.Normal;
markerLayout.FontDescription.Style = Pango.Style.Normal;
defaultLayout.FontDescription = textEditor.Options.Font;
using (var metrics = textEditor.PangoContext.GetMetrics (textEditor.Options.Font, textEditor.PangoContext.Language)) {
this.textEditor.GetTextEditorData ().LineHeight = System.Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale);
this.charWidth = metrics.ApproximateCharWidth / Pango.Scale.PangoScale;
}
// Gutter font may be bigger
using (var metrics = textEditor.PangoContext.GetMetrics (textEditor.Options.GutterFont, textEditor.PangoContext.Language)) {
this.textEditor.GetTextEditorData ().LineHeight = System.Math.Max (this.textEditor.GetTextEditorData ().LineHeight, System.Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale));
}
textEditor.LineHeight = System.Math.Max (1, LineHeight);
if (eolMarkerLayout == null) {
eolMarkerLayout = new Pango.Layout[markerTexts.Length];
eolMarkerLayoutRect = new Pango.Rectangle[markerTexts.Length];
for (int i = 0; i < eolMarkerLayout.Length; i++)
eolMarkerLayout[i] = PangoUtil.CreateLayout (textEditor);
}
var font = textEditor.Options.Font.Copy ();
font.Size = font.Size * 3 / 4;
Pango.Rectangle logRect;
for (int i = 0; i < eolMarkerLayout.Length; i++) {
var layout = eolMarkerLayout [i];
layout.FontDescription = font;
layout.SetText (markerTexts [i]);
Pango.Rectangle tRect;
layout.GetPixelExtents (out logRect, out tRect);
eolMarkerLayoutRect [i] = tRect;
}
if (tabArray != null) {
tabArray.Dispose ();
tabArray = null;
}
var tabWidthLayout = PangoUtil.CreateLayout (textEditor, (new string (' ', textEditor.Options.TabSize)));
tabWidthLayout.Alignment = Pango.Alignment.Left;
tabWidthLayout.FontDescription = textEditor.Options.Font;
int tabWidth, h;
tabWidthLayout.GetSize (out tabWidth, out h);
tabWidthLayout.Dispose ();
tabArray = new Pango.TabArray (1, false);
tabArray.SetTab (0, Pango.TabAlign.Left, tabWidth);
textEditor.UpdatePreeditLineHeight ();
DisposeLayoutDict ();
chunkDict.Clear ();
caretX = caretY = -LineHeight;
}