You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text in SVG with filter is rasterized at low resolution #4926
This issue is already known and is already fixed in the newest development version, so it will work fine in the next update. See here: #3715
text gets blurry
The reason this is happening is because you have a guassian blur filter that is applied to the text. Since those cannot be represented natively in PDF, Typst instead resorts to rasterizing them, and in this case it unfortunately results in a very low resolution being chosen... Ideally, this should be configurable. With that said, you can avoid this in the first place by not applying a gaussian blur to the text, which you probably wouldn't want to do, anyway. 😄
the blurry text:
For future people finding this: I edited the text of the svg file and removed the filter line in the sections belonging to the text fields. This solved my problem
Is this issue something that will be worked on - I mean technically you closed it by solving my problem but it still would be nice if svgs look the same in the compiled pdf as they look in other viewers. I leave it up to you to decide :)
This issue is already known and is already fixed in the newest development version, so it will work fine in the next update. See here: #3715
text gets blurry
The reason this is happening is because you have a guassian blur filter that is applied to the text. Since those cannot be represented natively in PDF, Typst instead resorts to rasterizing them, and in this case it unfortunately results in a very low resolution being chosen... Ideally, this should be configurable. With that said, you can avoid this in the first place by not applying a gaussian blur to the text, which you probably wouldn't want to do, anyway. 😄
I think technically it could be done with a type 1 shader? But it would be complicated and performance would probably be truly terrible....
No idea, maybe it's possible somehow, but even if so there are other filters which most definitely are not possible, so it's much easier to just rasterize the SVG group as soon as we encounter at least one filter, instead of making case distinctions, especially when you have combined filters.
The current rasterization resolution also leads to blurry edges at objects which should otherwise have a clearly defined corner. See the attached files.svg.pdf svg.svg
Activity
LaurenzV commentedon Sep 9, 2024
This issue is already known and is already fixed in the newest development version, so it will work fine in the next update. See here: #3715
The reason this is happening is because you have a guassian blur filter that is applied to the text. Since those cannot be represented natively in PDF, Typst instead resorts to rasterizing them, and in this case it unfortunately results in a very low resolution being chosen... Ideally, this should be configurable. With that said, you can avoid this in the first place by not applying a gaussian blur to the text, which you probably wouldn't want to do, anyway. 😄
sebaseb98 commentedon Sep 10, 2024
Thank you so much @LaurenzV!
For future people finding this: I edited the text of the svg file and removed the filter line in the sections belonging to the text fields. This solved my problem
Is this issue something that will be worked on - I mean technically you closed it by solving my problem but it still would be nice if svgs look the same in the compiled pdf as they look in other viewers. I leave it up to you to decide :)
LaurenzV commentedon Sep 10, 2024
Yes, let’s keep it up until there is a way to adjust that from Typst.
Enivex commentedon Sep 10, 2024
I think technically it could be done with a type 1 shader? But it would be complicated and performance would probably be truly terrible....
LaurenzV commentedon Sep 10, 2024
No idea, maybe it's possible somehow, but even if so there are other filters which most definitely are not possible, so it's much easier to just rasterize the SVG group as soon as we encounter at least one filter, instead of making case distinctions, especially when you have combined filters.
[-]svg image not displayed correctly in compiled pdf[/-][+]SVG image not displayed correctly in compiled PDF[/+][-]SVG image not displayed correctly in compiled PDF[/-][+]Text in SVG with filter is rasterized at low resolution[/+]laurmaedje commentedon Oct 8, 2024
Do we really want to make that adjustable? That seems like a tad low-level for me. Can't we just increase the resolution to something that works well?
LaurenzV commentedon Oct 8, 2024
I guess that would work too, but we would have to adapt it depending on how big it ends up in the final PDF.
EpicEricEE commentedon Oct 8, 2024
Maybe this can somehow be combined with #2554 to a single parameter for image resolutions, which for SVG then only accounts for the rasterized part?
nineff commentedon Oct 9, 2024
The current rasterization resolution also leads to blurry edges at objects which should otherwise have a clearly defined corner. See the attached files.svg.pdf
svg.svg