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
There seems to be a bug in the text-anchor implementation.
If you render a svg with a <text> that contains a text-anchor value other than empty/start, it will not place the text correctly.
I'm almost sure the problem is, that the renderer applies the anchor only to the first character in the text.
It generates the following expected image in a browser (Opera in this case):
But the same svg rendered with sharp vectors generates this:
As you can see, the sharp vector renderer places the Testpattern text right at the center of the first letter (T) if the text-anchor="middle" is set.
For the text-anchor="end" it draws all letters on top of each other, ending on the anchor.
I reviewed the generated XAML code and saw that each letter is translated into an own path. Maybe the problem starts somewhere there.
I'm sorry I can't afford to check the code myself right now, but hopefully, these hints will help.
The text was updated successfully, but these errors were encountered:
There seems to be a bug in the
text-anchor
implementation.If you render a svg with a
<text>
that contains atext-anchor
value other than empty/start, it will not place the text correctly.I'm almost sure the problem is, that the renderer applies the anchor only to the first character in the text.
Please see this example:
It generates the following expected image in a browser (Opera in this case):
But the same svg rendered with sharp vectors generates this:
As you can see, the sharp vector renderer places the
Testpattern
text right at the center of the first letter (T) if thetext-anchor="middle"
is set.For the
text-anchor="end"
it draws all letters on top of each other, ending on the anchor.I reviewed the generated XAML code and saw that each letter is translated into an own path. Maybe the problem starts somewhere there.
I'm sorry I can't afford to check the code myself right now, but hopefully, these hints will help.
The text was updated successfully, but these errors were encountered: