문제

I use CreateTextLayout and CreateTextFormat to draw text with DirectWrite (C++), the text is mixed Hebrew/English, is there a way to use a different font/font size for the Latin and Hebrew characters?

Thanks.

도움이 되었습니까?

해결책 2

I ended up calling IDWriteFont::HasCharacter to build text ranges inside which all characters use the same font (the hebrew or the latin one).

If that text range uses the hebrew font, I call textLayout->SetFontSize on it to increase the font size.

This amounts to anticipating the font callback DirectWrite will do, which is automatic and cannot be customized.

다른 팁

When you create the IDWriteTextFormat using CreateTextFormat, you can pass the name of the font family in the first parameter and you can change the size of the font in sixth parameter.

You can get the CreateTextFormat parameters from MSDN.

Here is a list of Microsoft Windows font families, you will find ones in Latin and Hebrew there.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top