c++pdfpdf-generationmako-sdk

How can I create an IDOMFont instance for a font file?


I'm using the Mako SDK and I need to create an IDOMFont instance for use in other APIs, but I can't see how to do this.

The font is an OpenType font and located locally on disk.

I've seen IInputStream, but I don't know how I can use this to create an IDOMFont instance.


Solution

  • The font instance can be created using the following API:

    static EDL_API IDOMFontOpenTypePtr create(IEDLClassFactory *pFactory, const IInputStreamPtr &stream);
    

    To use the API, you can use code similar to the following:

    IInputStreamPtr fontStream = IInputStream::createFromFile(jawsMako, "myfont.otf");
    IDOMFontPtr font = IDOMFontOpenType::create(jawsMako, fontStream);
    

    For more information, see:

    https://api.globalgraphics.com/mako/a00712.html

    https://api.globalgraphics.com/mako/a01080.html