I am using Harfbuzz and Freetype to render text. In Korean, when there is some English text in some vertical text, it should be rendered horizontally then rotated 90 degrees. Like this:
Proper Rendering
So, to try to accomplish this I have shaped two pieces of text with Harfbuzz. One vertical, and one horizontal. Then, I have rotated the horizontal text by 90 degrees. This is what I get:
What I get
You can see the problem is that the horizontal text isn’t in line with the vertical text. This is because the vertical text has a negative x_offset
so that the characters all line up perfectly. If I ignore the x_offset
this is what I get:
Ignoring x offset
So now the two line segments are properly aligned, but of course now the vertical text is incorrect because I’ve ignored the x_offset
.
If I could reverse the direction of the x_offset
then the result would be what I want. Unfortunately I don’t know if there’s a property of the freetype font or something in harfbuzz that corresponds to the width I would need to do the x_offset
in the opposite direction.
I’m probably just missing something simple, but does anyone know how I can do this?
Lazy1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.