【问题标题】:Vertical Text with DirectWrite (+270° rotated)使用 DirectWrite 的垂直文本(+270° 旋转)
【发布时间】:2019-03-07 11:51:09
【问题描述】:

我需要在我的 direct2d 应用程序中显示垂直文本。以下文本格式代码将文本旋转 +90°。

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

但我想将文本旋转 +270°,如下所示:

SetReadingDirection 和 SetFlowDirection 中还有许多其他选项。但他们都没有工作。以下示例也仅旋转了 +90°:DirectWrite vertical text sample

如果我手动旋转文本,它看起来很模糊:

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

谁能帮我解决这个问题?

问候,

【问题讨论】:

  • directx-11 标记在这里看起来不相关。
  • 如果我用 Transform => Test DiretWritte rotated 旋转它,它对我来说似乎并不模糊

标签: directx-11 direct2d directwrite


【解决方案1】:

在这种情况下,我不认为旋转角度对用户而言,也不应该如此。这是布局过程的一部分,您不需要干预,它是关于显示水平脚本和垂直脚本,请参阅 [1]。

关于transforms的视觉伪影,这听起来很正常,看看CreateGlyphRunAnalysis()考虑transforms的方法,也许这会给你更好的结果。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-14
    • 1970-01-01
    • 2016-03-27
    • 1970-01-01
    相关资源
    最近更新 更多