Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
e0822ae2
Commit
e0822ae2
authored
Apr 23, 2014
by
Tebjan Halm
Browse files
Merge pull request #62 from tobiasoort/master
Added support for dx and dy properties for text.
parents
04d48a36
da02167c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Text/SvgText.cs
View file @
e0822ae2
...
...
@@ -19,6 +19,8 @@ namespace Svg
{
private
SvgUnit
_x
;
private
SvgUnit
_y
;
private
SvgUnit
_dy
;
private
SvgUnit
_dx
;
private
SvgUnit
_letterSpacing
;
private
SvgUnit
_wordSpacing
;
private
SvgUnit
_fontSize
;
...
...
@@ -47,6 +49,8 @@ namespace Svg
{
this
.
_fontFamily
=
DefaultFontFamily
;
this
.
_fontSize
=
new
SvgUnit
(
0.0f
);
this
.
_dy
=
new
SvgUnit
(
0.0f
);
this
.
_dx
=
new
SvgUnit
(
0.0f
);
}
/// <summary>
...
...
@@ -97,6 +101,25 @@ namespace Svg
}
}
/// <summary>
/// Gets or sets the dX.
/// </summary>
/// <value>The dX.</value>
[
SvgAttribute
(
"dx"
)]
public
virtual
SvgUnit
Dx
{
get
{
return
this
.
_dx
;
}
set
{
if
(
_dx
!=
value
)
{
this
.
_dx
=
value
;
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"dx"
,
Value
=
value
});
}
}
}
/// <summary>
/// Gets or sets the Y.
/// </summary>
...
...
@@ -116,6 +139,25 @@ namespace Svg
}
}
/// <summary>
/// Gets or sets the dY.
/// </summary>
/// <value>The dY.</value>
[
SvgAttribute
(
"dy"
)]
public
virtual
SvgUnit
Dy
{
get
{
return
this
.
_dy
;
}
set
{
if
(
_dy
!=
value
)
{
this
.
_dy
=
value
;
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"dy"
,
Value
=
value
});
}
}
}
/// <summary>
/// Specifies spacing behavior between text characters.
/// </summary>
...
...
@@ -290,7 +332,7 @@ namespace Svg
_path
.
StartFigure
();
if
(!
string
.
IsNullOrEmpty
(
this
.
Text
))
DrawString
(
_path
,
this
.
X
,
this
.
Y
,
SvgUnit
.
Empty
,
SvgUnit
.
Empt
y
,
font
,
fontSize
,
this
.
Text
);
DrawString
(
_path
,
this
.
X
,
this
.
Y
,
this
.
Dx
,
this
.
D
y
,
font
,
fontSize
,
this
.
Text
);
foreach
(
var
tspan
in
this
.
Children
.
Where
(
x
=>
x
is
SvgTextSpan
).
Select
(
x
=>
x
as
SvgTextSpan
))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment