resvg
resvg copied to clipboard
Support alignment-baseline
Looking forward to this! When do you think it will be ready?
No idea.
This would be really useful because Chrome supports it. The tests just mention "hanging" but I'm trying to use other values like "central" and "text-before-edge". I've posted a bounty: https://app.bountysource.com/issues/89281644-support-alignment-baseline
Here's a file that renders differently in resvg compared to Chrome:
$500? Really? I'm not sure how hard it would be to implement, but that's a lot.
Oh, it's my first bounty. It's worth it to us so we don't have to find a workaround. Happy to support resvg. It's a great project.
Well, if you want to sponsor me directly, there is no need for BountySource. I'm not even sure if it works in my country.
As for the bug, it could take from 2 days up to a week. I haven't looked into it much. Half of the time will be spent on writing tests anyway. And will probably require adding BASE
and bsln
tables support to ttf-parser
.
Not sure if someone else would be able to figure it all out. There is a reason why it's not implemented. I might look into it on the weekend, but no promises. Very busy.
@gmeeker Added an absolute minimal support (54489e03b73b6bc83957dfe7331).
It's very simple, but should be as good as Chrome since it does't really implement this property properly either. You can find more in-depth overview here.
Currently, only a horizontal layout is supported. Vertical should be rewritten from scratch...
Technically, I should also take the current text script into account, but doesn't look like Chrome does it and it would be even more complicated.
Either way, the current implementation should be good enough for your use case and more will come later. Including dominant-baseline
.
Added dominant-baseline
support as well.
And by "added" I mean that resvg produces the same output as Chrome. Because Chrome, Firefox and Safari all produce different output when you start mixing dominant-baseline
and alignment-baseline
.
Baseline support in general is pretty tragic across all SVG apps: https://razrfalcon.github.io/resvg-test-suite/svg-support-table.html#a-dominant-baseline
I'm closing this in favor of #558 and #559