Comments (9)
I don't think any app except browsers does support @font-face
. So this will not be universal anyway.
To get the expected results, you have to simply install those fonts. That's it.
from resvg-test-suite.
I don't think any app except browsers does support @font-face. So this will not be universal anyway.
Below is the result for Batik 1.14, I think most libraries with complete CSS support implement @font-face
. Installation does not map for generic fonts like serif
, monospace
etc.
Without Styling (current default) | With Styling (above css embedded) |
---|---|
from resvg-test-suite.
Are you sure? I've just tested this file:
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<title>Simple case</title>
<style>
.fantasy {
font-family: "Sedgwick Ave Display", fantasy;
}
@font-face {
font-family: "Sedgwick Ave Display";
font-style: normal;
font-weight: 400;
src: url(../fonts/SedgwickAveDisplay-Regular.ttf) format('truetype');
}
</style>
<path id="crosshair" d="M 20 100 L 180 100 M 100 20 L 100 180"
stroke="gray" stroke-width="0.5"/>
<text id="text1" x="32" y="100" font-family="fantasy" font-size="64">Text</text>
<!-- image frame -->
<rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>
And all applications, even browsers, ignored it.
from resvg-test-suite.
Installation does not map for generic fonts like serif, monospace etc.
Yes, you just have to check those tests manually. Testing cannot be automated anyway.
from resvg-test-suite.
And all applications, even browsers, ignored it.
True, however, the issue here requires a bit more investigation.
I used a different fantasy font, Old English Text MT (installed on my system) and it does not work in any browser and even in the Resvg (if you do not specify the --fantasy-family on the commandline).
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<title>Simple case</title>
<style>
.fantasy {
font-family: "Old English Text MT", fantasy;
}
</style>
<path id="crosshair" d="M 20 100 L 180 100 M 100 20 L 100 180"
stroke="gray" stroke-width="0.5"/>
<text id="text1" x="32" y="100" font-family="fantasy" font-size="48">Text</text>
<!-- image frame -->
<rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>
I also tried Papyrus for the fantasy font and it fails!
For Resvg, even setting Papyrus directly fails, but works in all browsers.
<svg id="svg1" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
<title>Simple case</title>
<path id="crosshair" d="M 20 100 L 180 100 M 100 20 L 100 180"
stroke="gray" stroke-width="0.5"/>
<text id="text1" x="32" y="100" font-family="Papyrus" font-size="48">Text</text>
<!-- image frame -->
<rect id="frame" x="1" y="1" width="198" height="198" fill="none" stroke="black"/>
</svg>
from resvg-test-suite.
Fonts testing is basically manual at this point. I simply checking that results are somewhat correct.
For example, if I set font-family
to monospace
, I don't care what font an app would choose, as long as it's monospace. I don't expect all apps to resolve the same font.
from resvg-test-suite.
@RazrFalcon I understand your point. As I stated earlier, I was trying to see if we can get a consistent results through a CSS definition (after seeing the results from Inkscape, the first sample).
However, the current results I am getting is that Resvg does not seem to support font-family installed on the system. Can you confirm this? I tried many and none is working for the sample above.
from resvg-test-suite.
resvg does support system fonts. It doesn't support @font-face
from CSS.
from resvg-test-suite.
Sadly, an SVG test suite has to be tailored to the lowest common denominator. Which means no CSS.
For example, librsvg doesn't allow external images at all. So we have to bloat our tests with base64 encoded one.
from resvg-test-suite.
Related Issues (20)
- W3C test suite Revision version differs between png and svg HOT 2
- update official.csv for librsvg 2.5X HOT 1
- [featureRequest] terminal-comands for vdiff HOT 1
- FYI duplicates HOT 1
- textLength HOT 2
- Tests Validity HOT 10
- vdiff supports Qt6? HOT 2
- Test against Safari
- Do not use text in a-stroke-opacity tests
- Test `filter` with external url
- Figure out how to trigger `no-composite` property of `feBlend`
- e-radialGradient-044: focal point overlapping should result in no gradient drawn HOT 1
- e-radialGradient-031: Focal point correction changed in SVG2 HOT 1
- [vdiff] inkscape does not work on Gnome, but on KDE and Xfce HOT 4
- Issue with `structure/transform/rotate-at-position.svg`? HOT 1
- Tests `marker-on-rounded-rect` and `orient=audo-on-M-C-C-4` wrong HOT 2
- `image-with-float-size-scaling` has wrong resolution? HOT 3
- WPT-compatible tests? HOT 3
- Upgrade Chrome to the latest stable version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resvg-test-suite.