-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font-size in em
unit does not work
#100
Labels
enhancement
help wanted
Help with creating a proper test-case, looking up the spec, or creating a pull request.
Comments
Example (place file ast test100.html in ./dist after building and copying <svg id="svg" width="100%" height="100%">
<g class="main" transform="translate(30, 20)">
<g fill="none" font-size="10" text-anchor="start">
<g opacity="1" transform="translate(0,40)">
<text fill="black" x="-25">3.50</text>
</g>
<g opacity="1" font-size="2em" transform="translate(0,10)">
<text fill="black" x="-25">5.00</text>
</g>
</g>
</g>
</svg>
<script src="./jspdf.debug.js"></script>
<script src="./svg2pdf.js"></script>
<script type="text/javascript">
const svgElement = document.getElementsByTagName('svg')[0];
const width = 200, height = 100;
const pdf = new jsPDF('l', 'pt', [width, height]);
svg2pdf(svgElement, pdf, {
xOffset: 0,
yOffset: 0,
scale: 1
});
pdf.save('myPDF.pdf');
</script> Screenshot from Chromium 73.0.3683.75 built on Debian 9.8, running on Debian 9.9 resulting PDF Using svg2pdf 9a3ff91 (master) |
zenker981
added a commit
to zenker981/svg2pdf.js
that referenced
this issue
Oct 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
help wanted
Help with creating a proper test-case, looking up the spec, or creating a pull request.
When using the unit
em
to specify a font size, the result is much smaller as expected.For example
font-size="2em"
Expectation: Display similar to the browser.
The text was updated successfully, but these errors were encountered: