I'm trying to use the custom text renderer (from the DirectWrite Hello World sample) in order to render fonts with an outline color different from the fill in.
However, when I set the text reading direction and flow vertically (for Japanese), two exceptions are thrown and nothing gets displayed
Exception thrown at 0x7675A6E2 in DWriteHelloWorld.exe: Microsoft C++ exception: OSException at memory location 0x0053EFFC.
Exception thrown at 0x7675A6E2 in DWriteHelloWorld.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
I was thinking, maybe the implementation of DrawGlyphRun() is incomplete but the function is actually never called: exception gets thrown before it can call it.
I have attached a patch file (just remove the .txt extension) that enables a quick switch between both behaviors:
in CustomText.cpp, there are three defines: ISOLATE_CALLS, ENABLE_JAPANESE_TEST, ENABLE_VERTICAL_TEST
ISOLATE_CALLS will remove all the superfluous calls (font weight, underline, typography etc)
ENABLE_JAPANESE_TEST will replace the string with some kanjis
ENABLE_VERTICAL_TEST will enable vertical reading and right to left flow
I have also added ENABLE_JAPANESE_TEST and ENABLE_VERTICAL_TEST to SimpleText.cpp, showing that without a custom text renderer it works
How to reproduce:
apply the patch file
build and run the sample
you can confirm in the Simple Test tab that vertical orientation works without a custom text renderer
switch to Custom Text Renderer tab to confirm it is not working
you can try a different combination of the defines to test the changes
I'm trying to use the custom text renderer (from the DirectWrite Hello World sample) in order to render fonts with an outline color different from the fill in. However, when I set the text reading direction and flow vertically (for Japanese), two exceptions are thrown and nothing gets displayed
I was thinking, maybe the implementation of DrawGlyphRun() is incomplete but the function is actually never called: exception gets thrown before it can call it.
I have attached a patch file (just remove the .txt extension) that enables a quick switch between both behaviors:
How to reproduce:
Environment:
Thank you in advance for the help.
vertical_jp_test_patch.diff.txt