Table of Contents

Class GlyphRunAnalysis

Namespace
SharpDX.DirectWrite
Assembly
SharpDX.Direct2D1.dll
[Guid("7d97dbf7-e085-42d4-81e3-6a883bded118")]
public class GlyphRunAnalysis : ComObject
Inheritance
GlyphRunAnalysis

Constructors

GlyphRunAnalysis(Factory, GlyphRun, float, RenderingMode, MeasuringMode, float, float)

Creates a glyph run analysis object, which encapsulates information used to render a glyph run.

public GlyphRunAnalysis(Factory factory, GlyphRun glyphRun, float pixelsPerDip, RenderingMode renderingMode, MeasuringMode measuringMode, float baselineOriginX, float baselineOriginY)

Parameters

factory Factory

The factory.

glyphRun GlyphRun

A structure that contains the properties of the glyph run (font face, advances, and so on).

pixelsPerDip float

Number of physical pixels per DIP (device independent pixel). For example, if rendering onto a 96 DPI bitmap then pixelsPerDip is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 1.25.

renderingMode RenderingMode

A value that specifies the rendering mode, which must be one of the raster rendering modes (that is, not default and not outline).

measuringMode MeasuringMode

Specifies the measuring mode to use with glyphs.

baselineOriginX float

The horizontal position (X-coordinate) of the baseline origin, in DIPs.

baselineOriginY float

Vertical position (Y-coordinate) of the baseline origin, in DIPs.

Remarks

The glyph run analysis object contains the results of analyzing the glyph run, including the positions of all the glyphs and references to all of the rasterized glyphs in the font cache.

GlyphRunAnalysis(Factory, GlyphRun, float, RawMatrix3x2?, RenderingMode, MeasuringMode, float, float)

Creates a glyph run analysis object, which encapsulates information used to render a glyph run.

public GlyphRunAnalysis(Factory factory, GlyphRun glyphRun, float pixelsPerDip, RawMatrix3x2? transform, RenderingMode renderingMode, MeasuringMode measuringMode, float baselineOriginX, float baselineOriginY)

Parameters

factory Factory

The factory.

glyphRun GlyphRun

A structure that contains the properties of the glyph run (font face, advances, and so on).

pixelsPerDip float

Number of physical pixels per DIP (device independent pixel). For example, if rendering onto a 96 DPI bitmap then pixelsPerDip is 1. If rendering onto a 120 DPI bitmap then pixelsPerDip is 1.25.

transform RawMatrix3x2?

Optional transform applied to the glyphs and their positions. This transform is applied after the scaling specified the emSize and pixelsPerDip.

renderingMode RenderingMode

A value that specifies the rendering mode, which must be one of the raster rendering modes (that is, not default and not outline).

measuringMode MeasuringMode

Specifies the measuring mode to use with glyphs.

baselineOriginX float

The horizontal position (X-coordinate) of the baseline origin, in DIPs.

baselineOriginY float

Vertical position (Y-coordinate) of the baseline origin, in DIPs.

Remarks

The glyph run analysis object contains the results of analyzing the glyph run, including the positions of all the glyphs and references to all of the rasterized glyphs in the font cache.

GlyphRunAnalysis(nint)

public GlyphRunAnalysis(nint nativePtr)

Parameters

nativePtr nint

Methods

CreateAlphaTexture(TextureType, RawRectangle, byte[], int)

Creates an alpha texture of the specified type for glyphs within a specified bounding rectangle.

public void CreateAlphaTexture(TextureType textureType, RawRectangle textureBounds, byte[] alphaValues, int bufferSize)

Parameters

textureType TextureType

A value that specifies the type of texture requested. This can be DWRITE_TEXTURE_BILEVEL_1x1 or DWRITE_TEXTURE_CLEARTYPE_3x1. If a bi-level texture is requested, the texture contains only bi-level glyphs. Otherwise, the texture contains only antialiased glyphs.

textureBounds RawRectangle

The bounding rectangle of the texture, which can be different than the bounding rectangle returned by GetAlphaTextureBounds.

alphaValues byte[]

When this method returns, contains the array of alpha values from the texture. The buffer allocated for this array must be at least the size of bufferSize.

bufferSize int

The size of the alphaValues array, in bytes. The minimum size depends on the dimensions of the rectangle and the type of texture requested.

GetAlphaBlendParams(RenderingParams, out float, out float, out float)

Gets alpha blending properties required for ClearType blending.

public void GetAlphaBlendParams(RenderingParams renderingParams, out float blendGamma, out float blendEnhancedContrast, out float blendClearTypeLevel)

Parameters

renderingParams RenderingParams

An object that specifies the ClearType level and enhanced contrast, gamma, pixel geometry, and rendering mode. In most cases, the values returned by the output parameters of this method are based on the properties of this object, unless a GDI-compatible rendering mode was specified.

blendGamma float

When this method returns, contains the gamma value to use for gamma correction.

blendEnhancedContrast float

When this method returns, contains the enhanced contrast value to be used for blending.

blendClearTypeLevel float

When this method returns, contains the ClearType level used in the alpha blending.

GetAlphaTextureBounds(TextureType)

Gets the bounding rectangle of the physical pixels affected by the glyph run.

public RawRectangle GetAlphaTextureBounds(TextureType textureType)

Parameters

textureType TextureType

Specifies the type of texture requested. If a bi-level texture is requested, the bounding rectangle includes only bi-level glyphs. Otherwise, the bounding rectangle includes only antialiased glyphs.

Returns

RawRectangle

When this method returns, contains the bounding rectangle of the physical pixels affected by the glyph run, or an empty rectangle if there are no glyphs of the specified texture type.

Operators

explicit operator GlyphRunAnalysis(nint)

public static explicit operator GlyphRunAnalysis(nint nativePtr)

Parameters

nativePtr nint

Returns

GlyphRunAnalysis