EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowCase", "Samples\ShowCase\ShowCase.csproj", "{56329D48-D382-4850-93DE-59C453894E8A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{C40A3F21-0558-4265-9251-718C1564D10A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Release|Any CPU.Build.0 = Release|Any CPU
{56329D48-D382-4850-93DE-59C453894E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C40A3F21-0558-4265-9251-718C1564D10A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C40A3F21-0558-4265-9251-718C1564D10A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F535A8AB-CD93-49AB-B1B0-FFF9AE51ED6A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
- {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+ {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
EndGlobalSection
EndGlobal
if (lines == null)
lines = getLines;
if (!textMeasureIsUpToDate) {
- using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
- using (Context gr = new Context (img)) {
- //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;
-
- fe = gr.FontExtents;
- te = new TextExtents ();
-
- cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2;
-
- try {
- for (int i = 0; i < lines.Count; i++) {
- string l = lines[i].Replace ("\t", new String (' ', Interface.TabSize));
-
- TextExtents tmp = gr.TextExtents (l);
-
- if (tmp.XAdvance > te.XAdvance)
- te = tmp;
- }
- cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2;
- textMeasureIsUpToDate = true;
- } catch {
- return -1;
- }
- }
- }
+ using (Context gr = new Context (IFace.surf)) {
+ //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;
+
+ fe = gr.FontExtents;
+ te = new TextExtents ();
+
+ cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2;
+ try {
+ for (int i = 0; i < lines.Count; i++) {
+ string l = lines[i].Replace ("\t", new String (' ', Interface.TabSize));
+
+ TextExtents tmp = gr.TextExtents (l);
+
+ if (tmp.XAdvance > te.XAdvance)
+ te = tmp;
+ }
+ cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2;
+ textMeasureIsUpToDate = true;
+ } catch {
+ return -1;
+ }
+ }
}
return lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width;
}
{
if (lines == null)
lines = getLines;
+
+ using (Context gr = new Context (IFace.surf)) {
+ //Cairo.FontFace cf = gr.GetContextFontFace ();
- using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
- using (Context gr = new Context (img)) {
- //Cairo.FontFace cf = gr.GetContextFontFace ();
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
- gr.SetFontSize (Font.Size);
+ fe = gr.FontExtents;
+ te = new TextExtents ();
- fe = gr.FontExtents;
- te = new TextExtents ();
+ if (lt == LayoutingType.Height) {
+ int lc = lines.Count;
+ //ensure minimal height = text line height
+ if (lc == 0)
+ lc = 1;
- if (lt == LayoutingType.Height) {
- int lc = lines.Count;
- //ensure minimal height = text line height
- if (lc == 0)
- lc = 1;
-
- return (int)(fe.Height * lc) + Margin * 2;
- }
+ return (int)(fe.Height * lc) + Margin * 2;
+ }
- foreach (string s in lines) {
- string l = s.Replace("\t", new String (' ', Interface.TabSize));
- TextExtents tmp = gr.TextExtents (l);
- if (tmp.XAdvance > te.XAdvance)
- te = tmp;
- }
- return (int)Math.Ceiling (te.XAdvance) + Margin * 2;
+ foreach (string s in lines) {
+ string l = s.Replace("\t", new String (' ', Interface.TabSize));
+ TextExtents tmp = gr.TextExtents (l);
+ if (tmp.XAdvance > te.XAdvance)
+ te = tmp;
}
+ return (int)Math.Ceiling (te.XAdvance) + Margin * 2;
}
}
protected override void onDraw (Context gr)