Interfaz IDWriteGlyphRunAnalysis (dwrite.h)

Contiene información de bajo nivel que se usa para representar una ejecución de glifo.

Herencia

La interfaz IDWriteGlyphRunAnalysis hereda de la interfaz IUnknown . IDWriteGlyphRunAnalysis también tiene estos tipos de miembros:

Métodos

La interfaz IDWriteGlyphRunAnalysis tiene estos métodos.

 
IDWriteGlyphRunAnalysis::CreateAlphaTexture

Crea una textura alfa del tipo especificado para glifos dentro de un rectángulo delimitador especificado.
IDWriteGlyphRunAnalysis::GetAlphaBlendParams

Obtiene las propiedades de combinación alfa necesarias para la mezcla ClearType.
IDWriteGlyphRunAnalysis::GetAlphaTextureBounds

Obtiene el rectángulo delimitador de los píxeles físicos afectados por la ejecución del glifo.

Comentarios

La textura alfa puede ser una textura alfa de nivel bi o una textura alfa ClearType.

Una textura alfa de nivel bi contiene un byte por píxel, por lo que el tamaño del búfer de una textura de nivel bi será el área de los límites de textura, en bytes. Cada byte de una textura alfa de dos niveles creada por CreateAlphaTexture se establece en DWRITE_ALPHA_MAX (es decir, 255) o cero.

Una textura alfa ClearType contiene tres bytes por píxel, por lo que el tamaño del búfer para una textura alfa ClearType es tres veces el área de los límites de textura, en bytes.

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear un objeto de análisis de ejecución de glifos. En este ejemplo, se usa una ejecución de glifo vacía.

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;
}

Requisitos

   
Cliente mínimo compatible Windows 7, Windows Vista con SP2 y Platform Update para Windows Vista [aplicaciones de escritorio | Aplicaciones para UWP]
Servidor mínimo compatible Windows Server 2008 R2, Windows Server 2008 con SP2 y Actualización de plataforma para Windows Server 2008 [aplicaciones de escritorio | Aplicaciones para UWP]
Plataforma de destino Windows
Encabezado dwrite.h