Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Triger <kostat@mono-cvs.ximian.com>2005-11-13 14:33:53 +0300
committerKonstantin Triger <kostat@mono-cvs.ximian.com>2005-11-13 14:33:53 +0300
commit459555c9d3452872c9ed52e41d9bd491c2cd3dc0 (patch)
tree85a3bfc16073249cfd99a45692e2ebee0cef9bb9 /mcs/class/System.Drawing/System.Drawing.Drawing2D
parent8a727b19357a3e36052f6ef2f059a3ed6a320372 (diff)
text support
svn path=/trunk/mcs/; revision=52965
Diffstat (limited to 'mcs/class/System.Drawing/System.Drawing.Drawing2D')
-rw-r--r--mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog4
-rwxr-xr-xmcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs38
2 files changed, 34 insertions, 8 deletions
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
index 96177f685d9..97eb9710369 100644
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/ChangeLog
@@ -1,5 +1,9 @@
2005-11-13 Konstantin Triger <kostat@mainsoft.com>
+ * GraphicsPath.jvm.cs: AddString support.
+
+2005-11-13 Konstantin Triger <kostat@mainsoft.com>
+
* ExtendedGeneralPath.jvm.cs: restore quadTo as curveTo affects quality
2005-11-13 Konstantin Triger <kostat@mainsoft.com>
diff --git a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs
index f0626bdba9b..76363d614d2 100755
--- a/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs
+++ b/mcs/class/System.Drawing/System.Drawing.Drawing2D/GraphicsPath.jvm.cs
@@ -28,6 +28,7 @@
//
using System;
using System.Drawing;
+using System.Drawing.Text;
using System.Collections;
using java.awt.geom;
using java.awt;
@@ -775,28 +776,49 @@ namespace System.Drawing.Drawing2D
#endregion
#region AddString
- [MonoTODO]
public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
{
- throw new NotImplementedException ();
+ AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
+ format);
}
- [MonoTODO]
public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
{
- throw new NotImplementedException ();
+ AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World), origin.X, origin.Y, float.PositiveInfinity, float.PositiveInfinity,
+ format);
}
- [MonoTODO]
public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
{
- throw new NotImplementedException ();
+ AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
+ layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
+ format);
}
- [MonoTODO]
public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
{
- throw new NotImplementedException ();
+ AddString(s, new Font(family, emSize, (FontStyle)style, GraphicsUnit.World),
+ layoutRect.X, layoutRect.Y, layoutRect.Width, layoutRect.Height,
+ format);
+ }
+
+ void AddString (string s, Font font,
+ float x, float y, float width, float height,
+ StringFormat format) {
+
+ TextLineIterator iter = new TextLineIterator(s, font,
+ new java.awt.font.FontRenderContext(null, false, false),
+ format, width, height);
+
+ int coordsCount = NativeObject.CoordsCount;
+
+ for (LineLayout layout = iter.NextLine(); layout != null; layout = iter.NextLine()) {
+ NativeObject.append(layout.GetOutline(x, y), false);
+ }
+
+ AffineTransform lineAlignT = iter.CalcLineAlignmentTransform();
+ if (lineAlignT != null)
+ NativeObject.transform(lineAlignT, coordsCount, NativeObject.CoordsCount - coordsCount);
}
#endregion