We create an IDWriteFactory7 CComPtr interface:
CComPtr<IDWriteFactory7> _writeFactory;
_hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(_writeFactory), reinterpret_cast<IUnknown**>(&_writeFactory));
Creating the Factory works. But if we try to create an IDWriteTextLayout4, with this Factory:
CComPtr<IDWriteTextLayout4> _textLayout;
_writeFactory->CreateTextLayout(
wtext.c_str(), // The string to be laid out and formatted.
wcslen(wtext.c_str()), // The length of the string.
_textFormat, // The text format to apply to the string (contains font information, etc).
size.width, // The width of the layout box.
size.height, // The height of the layout box.
&_textLayout // The IDWriteTextLayout interface pointer.
);
The CreateTextLayout(..) Method does not work with IDWriteTextLayout4, but instead expects IDWriteTextLayout.
Can anyone provide an example?