Hi,<br><br>I am writing an OLE server application. Such applications need to provide an old format Windows Metafile (and not an Enhanced Metafile) to container applications. I attempted to create a printing surface passing on the DC for a Windows Metafile, but got an out-of memory error. I deducted that cairo does not support Metafile surfaces. <br>

<br>Then I created an Enhanced Metafile and passed the resulting DC to cairo_win32_create_printing_surface and I was able to draw. Next, I wanted to convert the resulting metafile to a an old format Windows Metafile using the code below, but text simply disappears, if I use an OpenType font. However, if I use the &quot;Courier&quot; font it shows. <br>

<br>            unsigned size = GetWinMetaFileBits(hemf, 0, NULL, MM_ANISOTROPIC, pDC-&gt;m_hDC);<br>            BYTE *buff = (BYTE*)malloc(size);<br>            size = GetWinMetaFileBits(hemf, size, buff, MM_ANISOTROPIC, pDC-&gt;m_hDC);<br>

            HMETAFILE hwmf = SetMetaFileBitsEx(size, buff);<br><br>I attached two emf files showing the drawing and the resulting wmf files
that does/does not have the text in them. (Note that wmf files have a
thumbnail bitmap stored with them, which shows the text, but if you
drop the wmf onto a PowerPointslide, it misses the text.)<br><br>The funny thing is that both the emf and the wmf file contain the relevant textout records, but I cannot figure out why it never shows with TrueType/OpenType fonts in the wmf file. I have tried it both on Vista and XP.<br>

 <br>Can anyone give me a hint what may go wrong here, or how else to produce an old format Windows Metafile with Cairo?<br><br>Zoltan<br><br><br><br>