Click or drag to resize
CanvasFontFace.GetGlyphRunBounds Method (CanvasDrawingSession, Vector2, Single,CanvasGlyph[], Boolean, UInt32)
Gets the bounds of a glyph run using this font face.

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public Rect GetGlyphRunBounds(
	CanvasDrawingSession drawingSession,
	Vector2 point,
	float fontSize,
	CanvasGlyph[] glyphs,
	bool isSideways,
	uint bidiLevel
)

Parameters

drawingSession
Type: Microsoft.Graphics.Canvas.CanvasDrawingSession
point
Type: System.Numerics.Vector2
fontSize
Type: System.Single
glyphs
Type:Microsoft.Graphics.Canvas.Text.CanvasGlyph[]
isSideways
Type: System.Boolean
bidiLevel
Type: System.UInt32

Return Value

Type: Rect
Remarks

An app's DrawGlyphRun callback in its custom text renderer can use this method to get the bounds of a glyph run if it were drawn to a particular drawing session.

This method returns layout bounds, not draw bounds. For more information on the difference between the two, see LayoutBounds.

The returned bounds reflect the DPI, transform and unit mode of the CanvasDrawingSession passed in.

This method uses the measuring mode CanvasTextMeasuringMode.Natural.

See Also