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
50e5d1f7
Unverified
Commit
50e5d1f7
authored
Feb 20, 2019
by
mrbean-bremen
Browse files
Fixed intial font-size - now set to 1em
- added basic support for "medium", "small" etc. font-size values - fixes #419
parent
02ce5a4f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Source/DataTypes/SvgUnitConverter.cs
View file @
50e5d1f7
...
...
@@ -32,6 +32,23 @@ namespace Svg
if
(
unit
==
"none"
)
return
SvgUnit
.
None
;
// Note: these are ad-hoc values based on a factor of about 1.2 between adjacent values
// see https://www.w3.org/TR/CSS2/fonts.html#value-def-absolute-size for more information
if
(
unit
==
"medium"
)
unit
=
"1em"
;
else
if
(
unit
==
"small"
)
unit
=
"0.8em"
;
else
if
(
unit
==
"x-small"
)
unit
=
"0.7em"
;
else
if
(
unit
==
"xx-small"
)
unit
=
"0.6em"
;
else
if
(
unit
==
"large"
)
unit
=
"1.2em"
;
else
if
(
unit
==
"x-large"
)
unit
=
"1.4em"
;
else
if
(
unit
==
"xx-large"
)
unit
=
"1.7em"
;
for
(
int
i
=
0
;
i
<
unit
.
Length
;
i
++)
{
// If the character is a percent sign or a letter which is not an exponent 'e'
...
...
Source/SvgElementStyle.cs
View file @
50e5d1f7
...
...
@@ -361,7 +361,7 @@ namespace Svg
var
fontSizeUnit
=
this
.
FontSize
;
if
(
fontSizeUnit
==
SvgUnit
.
None
||
fontSizeUnit
==
SvgUnit
.
Empty
)
{
fontSize
=
1.0f
;
fontSize
=
new
SvgUnit
(
SvgUnitType
.
Em
,
1.0f
)
;
}
else
{
...
...
Tests/Svg.UnitTests/PassingTests.csv
View file @
50e5d1f7
...
...
@@ -199,6 +199,7 @@ __issue-345-01
__issue-354-01
__issue-385-01_Test_text-anchor-middle
__issue-398-01
__issue-419-01
__pull_request-373-01
__pull_request-374-01
__pull_request-414-01
...
...
Tests/W3CTestSuite/png/__issue-419-01.png
0 → 100644
View file @
50e5d1f7
997 Bytes
Tests/W3CTestSuite/svg/__issue-419-01.svg
0 → 100644
View file @
50e5d1f7
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<svg
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
id=
"seatplan"
>
<rect
id=
"stage"
x=
"100"
y=
"50"
width=
"100"
height=
"50"
fill=
"white"
stroke=
"black"
/>
<text
x=
"130"
y=
"80"
text-anchor=
"middle"
fill=
"black"
>
Stage
</text>
</svg>
\ No newline at end of file
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