bug 875329 - reftest for use of transforms within SVG-in-OT glyphs. r=heycam

This commit is contained in:
Jonathan Kew 2013-09-11 08:27:52 +01:00
Родитель eb19dbaccf
Коммит 033f3f9ca3
6 изменённых файлов: 166 добавлений и 1 удалений

Просмотреть файл

@ -19,3 +19,4 @@ pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-cachedopacity
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-objectvalue.svg svg-glyph-objectvalue-ref.svg
pref(gfx.font_rendering.opentype_svg.enabled,true) fails == svg-glyph-mask.svg svg-glyph-mask-ref.svg # bug 872483
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-paint-server.svg svg-glyph-paint-server-ref.svg # bug 801467
pref(gfx.font_rendering.opentype_svg.enabled,true) == svg-glyph-transform.svg svg-glyph-transform-ref.svg # bug 875329

Просмотреть файл

@ -7,4 +7,5 @@ nosvg.woff is derived from the "Liberation" font. It contains no SVG table.
svg.woff is nosvg.woff with an SVG table added. The
table contains the glyph documents glyphs-base.svg, glyphs-invalid.svg,
glyphs-objectcolor.svg, glyphs-objectopacity.svg and glyphs-objectstroke.svg.
glyphs-objectcolor.svg, glyphs-objectopacity.svg, glyphs-objectstroke.svg,
glyphs-paintservers.svg and glyphs-transforms.svg.

Просмотреть файл

@ -0,0 +1,67 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!--
SVG test glyphs for transforms within SVG glyphs
'g': simple red square used as a reference
'h': a smaller square, with a transform that should make it match the 'g'
'i': similar, applying a transform to the referenced element
'j': has a large blue square that should be transformed such that it is
completely hidden by the red
'k': tests the accumulation of several transforms
'l': checks that a transform from outside the glyph element is NOT applied
'm', 'n', 'o', 'p': all render the same <rect> but only 'm' and 'n' should be
transformed; 'o' and 'p' should match 'q'
'q': the unscaled small square, reference for 'o' and 'p' above
-->
<defs>
<!-- this rect will need to be scaled 5x to match the reference glyph 'g' -->
<rect id="small" x="50" y="-150" width="100" height="100" fill="red" />
</defs>
<!-- char 'g' -->
<rect id="glyph73" x="250" y="-750" width="500" height="500" fill="red" />
<!-- char 'h' -->
<rect id="glyph74" x="25" y="-75" width="50" height="50" transform="scale(10)" fill="red" />
<!-- char 'i' -->
<g id="glyph75">
<use xlink:href="#small" transform="scale(5)" />
</g>
<!-- char 'j' -->
<g id="glyph76">
<g transform="translate(300,-300) scale(0.4)">
<rect x="0" y="-1000" width="1000" height="1000" fill="blue" />
</g>
<g transform="scale(5)">
<use xlink:href="#small" />
</g>
</g>
<!-- char 'k' -->
<g id="glyph77" transform="scale(0.5)">
<g transform="scale(0.5)">
<use xlink:href="#small" transform="scale(20)" />
</g>
</g>
<!-- char 'l' -->
<g transform="scale(2)">
<g id="glyph78">
<use xlink:href="#small" transform="scale(5)" />
</g>
</g>
<g id="glyph79"> <!-- char 'm' -->
<g id="glyph80" transform="scale(5)"> <!-- char 'n' -->
<g id="glyph81"> <!-- char 'o' -->
<use id="glyph82" xlink:href="#small" /> <!-- char 'p' -->
</g>
</g>
</g>
<!-- char 'q' -->
<use id="glyph83" xlink:href="#small" />
</svg>

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg">
<style type="text/css">
<![CDATA[
@font-face {
font-family: "Liberation";
src:url(resources/svg.woff);
}
text
{
font-family: Liberation;
font-size: 100px;
}
]]>
</style>
<!--
Test that transforms within SVG glyph documents are applied properly
-->
<text x="0" y="100">
g
</text>
<text x="0" y="200">
g
</text>
<text x="0" y="300">
g
</text>
<text x="100" y="100">
g
</text>
<text x="100" y="200">
g
</text>
<text x="100" y="300">
g
</text>
<text x="200" y="100">
g
</text>
<!-- note that the next two are different from the preceding glyphs! -->
<text x="200" y="200">
q
</text>
<text x="200" y="300">
q
</text>
</svg>

После

Ширина:  |  Высота:  |  Размер: 803 B

Просмотреть файл

@ -0,0 +1,48 @@
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="600">
<style type="text/css">
<![CDATA[
@font-face {
font-family: "Liberation";
src:url(resources/svg.woff);
}
text
{
font-family: Liberation;
font-size: 100px;
}
]]>
</style>
<!--
Test that transforms within SVG glyph documents are applied properly
-->
<text x="0" y="100">
h
</text>
<text x="0" y="200">
i
</text>
<text x="0" y="300">
j
</text>
<text x="100" y="100">
k
</text>
<text x="100" y="200">
l
</text>
<text x="100" y="300">
m
</text>
<text x="200" y="100">
n
</text>
<!-- note that the next two are different from the preceding glyphs! -->
<text x="200" y="200">
o
</text>
<text x="200" y="300">
p
</text>
</svg>

После

Ширина:  |  Высота:  |  Размер: 828 B