INTERFACE IDWriteGlyphRunAnalysis (dwrite.h)

Contient des informations de bas niveau utilisées pour afficher une exécution de glyphe.

Héritage

L’interface IDWriteGlyphRunAnalysis hérite de l’interface IUnknown. IDWriteGlyphRunAnalysis a également les types de membres suivants :

Méthodes

L’interface IDWriteGlyphRunAnalysis a ces méthodes.

 
IDWriteGlyphRunAnalysis::CreateAlphaTexture

Crée une texture alpha du type spécifié pour les glyphes dans un rectangle englobant spécifié.
IDWriteGlyphRunAnalysis::GetAlphaBlendParams

Obtient les propriétés de fusion alpha requises pour le mélange ClearType.
IDWriteGlyphRunAnalysis::GetAlphaTextureBounds

Obtient le rectangle englobant des pixels physiques affectés par l’exécution du glyphe.

Notes

La texture alpha peut être une texture alpha à deux niveaux ou une texture alpha ClearType.

Une texture alpha à deux niveaux contient un octet par pixel. Par conséquent, la taille de la mémoire tampon d’une texture à deux niveaux sera la zone des limites de texture, en octets. Chaque octet dans une texture alpha à deux niveaux créée par CreateAlphaTexture est défini sur DWRITE_ALPHA_MAX (c’est-à-dire 255) ou zéro.

Une texture alpha ClearType contient trois octets par pixel. Par conséquent, la taille de la mémoire tampon d’une texture alpha ClearType est trois fois supérieure à la zone des limites de texture, en octets.

Exemples

L’exemple de code suivant montre comment créer un objet d’analyse d’exécution de glyphes. Dans cet exemple, une exécution de glyphe vide est utilisée.

HRESULT CreateGlyphRunAnalysis(IDWriteFontFace *pFontFace, IDWriteGlyphRunAnalysis **ppGlyphRunAnalysis)
{
    HRESULT hr = S_OK;
    IDWriteFactory* pDWriteFactory = NULL;

    // Create the DirectWrite factory.
    hr = DWriteCreateFactory(
            DWRITE_FACTORY_TYPE_SHARED,
            __uuidof(IDWriteFactory),
            reinterpret_cast<IUnknown**>(&pDWriteFactory)
            );

    DWRITE_GLYPH_RUN emptyGlyphRun = { 0 };
    UINT16 glyphIndex = 0;
    
    emptyGlyphRun.fontFace = pFontFace;
    emptyGlyphRun.glyphIndices = &glyphIndex;
    emptyGlyphRun.glyphCount = 0;
   
    emptyGlyphRun.fontEmSize = 12;

    IDWriteGlyphRunAnalysis* pGlyphRunAnalysis = NULL;

    if (SUCCEEDED(hr))
    {
        hr = pDWriteFactory->CreateGlyphRunAnalysis(
            &emptyGlyphRun,
            1.0f, // pixelsPerDip,
            NULL, // transform,
            DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
            DWRITE_MEASURING_MODE_GDI_CLASSIC,
            0.0f, // baselineOriginX,
            0.0f, // baselineOriginY,
            &pGlyphRunAnalysis);
    }
    
    *ppGlyphRunAnalysis = pGlyphRunAnalysis;

    SafeRelease(&pDWriteFactory);

    return S_OK;
}

Spécifications

   
Client minimal pris en charge Windows 7, Windows Vista avec SP2 et Mise à jour de plateforme pour Windows Vista [applications de bureau | Applications UWP]
Serveur minimal pris en charge Windows Server 2008 R2, Windows Server 2008 avec SP2 et Platform Update pour Windows Server 2008 [applications de bureau | Applications UWP]
Plateforme cible Windows
En-tête dwrite.h