2

I need to show vertical text in my direct2d application. Following text formatting code rotates the text +90°.

m_textFormat->SetReadingDirection(DWRITE_READING_DIRECTION_BOTTOM_TO_TOP));
m_textFormat->SetFlowDirection(DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT));

enter image description here

But I want to rotate the text +270° like the following:

enter image description here

There are many other options in SetReadingDirection and SetFlowDirection. But none of them is working. The following sample also rotates only +90°: DirectWrite vertical text sample

If I manually rotate the text, it looks blur:

renderTarget->SetTransform(Matrix3x2F::Rotation(m_rotation, Point2F(left + height / 2.0f, top + (bottom - top) / 2.0f)));

Can anyone please help me with this?

Regards,

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Liton
  • 1,398
  • 2
  • 14
  • 27

1 Answers1

1

I don't think rotation angle is to user in this context, and it shouldn't be. It's a part of layout process that you don't need to interfere with, it's about displaying horizontal scripts along with vertical ones, see [1].

Regarding visual artifacts of transforms, that sounds normal, look at CreateGlyphRunAnalysis() method that takes transform into account, maybe that will give you better results.

[1] https://www.unicode.org/reports/tr50/

bunglehead
  • 1,104
  • 1
  • 14
  • 22