Closed martijnhartlief closed 5 months ago
Hi!
It seems to work for me:
<body style="font-family: Fira Sans">
<div>Not tabular: 01234567890</div>
<div style="font-variant-numeric: tabular-nums">Tabular: 01234567890</div>
<div style="font-feature-settings: 'tnum'">Also tabular: 01234567890</div>
</body>
I’ve used Fira Sans. Maybe your font doesn’t support this OpenType feature?
Hey liZe, thanks for the quick reply!
I'm using Lora.
According to https://fontdrop.info/ the ttf, otf and woff all support tnum. The web preview I made works, but it's just not showing up in the PDF.
Do I need to do something specific to the font loading?
<style>
@font-face {
font-family: 'Lora';
src: url('fonts/Lora/Lora-Regular.otf') format('opentype');
font-weight: normal;
}
</style>
<body style="font-family: Lora">
<div>01234567890: Not tabular</div>
<div style="font-variant-numeric: tabular-nums">01234567890: Tabular</div>
<div style="font-feature-settings: 'tnum'">01234567890: Also tabular</div>
</body>
Here’s what I get with your example:
Are you sure that the font you’re using is the one from your link? Otherwise I don’t know what’s wrong. Maybe using the --verbose
CLI option could give interesting information.
After fiddling around I found out our staging server renders just fine.... The exact same code and weasyprint version on my dev machine unfortunately doesn't. The only difference being I'm using Mac OSX.
I'm using a few wrappers, but I'll come back to you with the cli output.
The exact same code and weasyprint version on my dev machine unfortunately doesn't.
Maybe you have another font with the same name installed system-wide?
Indeed I have. It is the exact same file as I load from the font directory.
But after I removed it, it worked. So I reinstalled it again and it keeps working... So perhaps it wasn't the same? It wasn't the same file.
Thanks for helping me out!
Are font-feature-settings supported?