vega / vl-convert

Utilities for converting Vega-Lite specs from the command line and Python
BSD 3-Clause "New" or "Revised" License
84 stars 9 forks source link

Experiencing issues with register_font_directory and semibold font files #167

Closed jcweaver closed 2 weeks ago

jcweaver commented 2 months ago

I'm on Python 3.11.8 and Version: 1.4.0 of vl-convert-python.

I'm using vl-convert-python to create png files of Altair charts that use a specific theme file alt.themes.register('jil_theme', jil_theme) alt.themes.enable('jil_theme')

My theme file has the following fonts: font_regular = "Matter" font_semibold = "Matter SemiBold"

But the png outputs do not recognize Matter SemiBold despite having the font file on my computer. They do recognize Matter so if I change font_semibold to Matter, it will output correctly. Also, if I specify the font weight to 600 where I want the charts to use a semibold, I can get the right output if the font_semibold is set to "Matter". If I specify font weight to 670, it does not work.

Let me know if you need more details about this, thanks!

jonmmease commented 2 months ago

Thanks for the report @jcweaver, I was able to reproduce what you're seeing.

This may be related to https://github.com/RazrFalcon/resvg/issues/702, which was fixed in version 0.39 of resvg. We're currently on 0.36.0, so this is a good reason to look into updating.

jcweaver commented 1 month ago

@jonmmease I was wondering if you had a projected date for this fix?

jonmmease commented 1 month ago

Hi @jcweaver, I did take a look at this and forgot to update the issue. We'll need to wait for a release of the svg2pdf crate before we can update resvg.


Hi @LaurenzV, do you have any plans for when you might publish the next version of svg2pdf to crates.io? Thanks!

LaurenzV commented 1 month ago

You'd have to ask @laurmaedje. But I think a new version will be published as soon as we've managed to update Typst to the newest resvg, which unfortunately proved to be a bit complicated...

LaurenzV commented 1 month ago

New version is out.

jonmmease commented 1 month ago

Thanks for the ping @LaurenzV!

jcweaver commented 3 weeks ago

@jonmmease any update on when you might be able to update this now that a new version of resvg is out? Thanks!

jonmmease commented 3 weeks ago

Hey @jcweaver, it's on my list and definitely something I'm planning to get to. But I don't have an ETA to share. There are a bunch of breaking changes in resvg/usvg to work through, so it's not just a matter of bumping the version unfortunately.