CanvasTextAnalyzerGetJustificationOpportunities Method |
Retrieves justification opportunity information, per-glyph.
Namespace:
Microsoft.Graphics.Canvas.Text
Assembly:
Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax Remarks
This is the place to start when performing justification on custom text layouts.
The order of things is to:
- Split up your text spans into glyph runs.
- Fit your glyph runs into the layout boxes. Perform word wrapping if desired.
- For each glyph run, call GetJustificationOpportunities to obtain an array of CanvasJustificationOpportunity.
- Pass an array of all CanvasJustificationOpportunity's for each layout box to
ApplyJustificationOpportunities(Single, CanvasJustificationOpportunity, CanvasGlyph).
- Assign the justified glyph data back into your app's glyph runs.
- Optionally, call
AddGlyphsAfterJustification(CanvasFontFace, Single, CanvasAnalyzedScript, Int32, CanvasGlyph, CanvasGlyph, CanvasGlyphShaping, Int32)
to insert extra justification glyphs- for example, if you would like to use Arabic kashida.
- Draw the glyph runs.
For an example which performs custom text layout justification, see
CustomTextLayouts.xaml.cs.
If a null font face is specified, the default font face will be used.
See Also