IXpsOMFontResource interface (xpsobjectmodel.h)

Provides an IStream interface to a font resource.

Inheritance

The IXpsOMFontResource interface inherits from IXpsOMResource. IXpsOMFontResource also has these types of members:

Methods

The IXpsOMFontResource interface has these methods.

 
IXpsOMFontResource::GetEmbeddingOption

Gets the embedding option that will be applied when the resource is serialized.
IXpsOMFontResource::GetStream

Gets a new, read-only copy of the stream that is associated with this resource. (IXpsOMFontResource.GetStream)
IXpsOMFontResource::SetContent

Sets the read-only stream to be associated with this resource. (IXpsOMFontResource.SetContent)

Remarks

The code example that follows illustrates how to create an instance of this interface.


IXpsOMFontResource    *newInterface;
IOpcPartUri           *partUri;

// Note the implicit requirement that CoInitializeEx 
//  has previously been called from this thread.

hr = CoCreateInstance(
    __uuidof(XpsOMObjectFactory),
    NULL,
    CLSCTX_INPROC_SERVER,
    _uuidof(IXpsOMObjectFactory),
    reinterpret_cast<LPVOID*>(&xpsFactory)
    );

if (SUCCEEDED(hr))
{
    // The partUriString and acquiredStream variables 
    //   are defined outside of this example.
    hr = xpsFactory->CreatePartUri(partUriString, &partUri);
    if (SUCCEEDED(hr))
    {
        hr = xpsFactory->CreateFontResource (
            acquiredStream, 
            XPS_FONT_EMBEDDING_NORMAL,    // normal
            partUri, 
            FALSE,                        // not obfuscated
            &newInterface);
        if (SUCCEEDED(hr))
        {
            // use newInterface

            newInterface->Release();
        }
        partUri->Release();
    }
    xpsFactory->Release();
}
else
{
    // evaluate HRESULT error returned in hr
}

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h

See also

IXpsOMObjectFactory::CreateFontResource

IXpsOMResource

Interfaces

XML Paper Specification