diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-05-07 08:12:56 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-05-07 08:12:56 +0200 |
| commit | 6b02331dfe7c6d8290c136ce20b4a7c655b47aae (patch) | |
| tree | da414ee19018edaf1d37b8fd7a6e4fe1f86edecd /src/GraphicObjects/Label.cs | |
| parent | f3344a78e511213d235e4c91bf507264fd41ac0d (diff) | |
first tests with vkvg as backendvkvg
Diffstat (limited to 'src/GraphicObjects/Label.cs')
| -rw-r--r-- | src/GraphicObjects/Label.cs | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index 0e0d9fe1..da332d02 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -28,7 +28,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Diagnostics; -using Cairo; +using vkvg; using System.Text.RegularExpressions; using System.Xml.Serialization; using System.ComponentModel; @@ -447,14 +447,17 @@ namespace Crow if (lines == null) lines = getLines; if (!textMeasureIsUpToDate) { - using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) { - using (Context gr = new Context (img)) { + //using (Surface img = new Surface (CrowApplication.dev, 10, 10)) { + if (bmp == null) + bmp = new Surface (CrowApplication.dev, 10, 10); + using (Context gr = new Context (bmp)) { //Cairo.FontFace cf = gr.GetContextFontFace (); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; + gr.FontFace = Font.Name; +// gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); +// gr.SetFontSize (Font.Size); +// gr.FontOptions = Interface.FontRenderingOptions; +// gr.Antialias = Interface.Antialias; fe = gr.FontExtents; te = new TextExtents (); @@ -476,7 +479,7 @@ namespace Crow return -1; } } - } + //} } return lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width; @@ -485,10 +488,11 @@ namespace Crow { base.onDraw (gr); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Interface.Antialias; + gr.FontFace = Font.Name; +// gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); +// gr.SetFontSize (Font.Size); +// gr.FontOptions = Interface.FontRenderingOptions; +// gr.Antialias = Interface.Antialias; rText = new Rectangle(new Size( measureRawSize(LayoutingType.Width), measureRawSize(LayoutingType.Height))); |