Is there a Windows GetFontData feature for Mac OSX?

We have an application that allows our users to create ready-to-print PDF documents using variable data (names, names, phone numbers, etc.) that their customer enters through the e-commerce website. To facilitate variable data, we need to embed the entire font character map. In windows, we use the Windows API function GetFontData (...) as follows:

#ifdef Q_WS_WIN
    //this is windows specific code
    HDC DC = CreateCompatibleDC(NULL);
    HFONT hFont = font.handle();
    HFONT oFont=(HFONT)SelectObject(DC,hFont);

    DWORD fontLength = ::GetFontData(DC, 0, 0, 0, 0);

    if(fontLength != GDI_ERROR)
    {
        fontData.GrowAllocation(fontLength);

        if(::GetFontData(DC, 0, 0, fontData.GetBuffer(), fontLength) == GDI_ERROR)
        {
            fontData.Clear();
        }
        else
        {
            fontData.SetLength(fontLength);
            returnVal = true;
        }
    }

    SelectObject(DC,oFont);
    DeleteDC(DC);
    //End of windows specific code
#elif defined(Q_WS_MAC)



#endif

This method works very well in our particular version of Windows; however, we ported the application to Qt for installation on the Mac OSX platform.

: Qt QFont, QFontDatabase .., pdf? . #ifdef . , fontData , , , .

: Qt OS, OSX GetFontData?

+3
2

GetFontData, Qt ( Qt ), ObjC , NSFont.

0

( , Apple ), API , , Apple , API Apple.:)

, , CTFont . , , , , .

0

All Articles