0

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?

bunglehead
  • 1,104
  • 1
  • 14
  • 22
P Weiss
  • 1
  • 1
  • 1

1 Answers1

0

Comments of systemcpro and Simon Mourier solved the Problem.

P Weiss
  • 1
  • 1
  • 1