Stroke Pen Path
3 nodes
On this page 3
Measure
FunctionThe advance width of a run, in drawing units.
Signature
Measure -> Low Accuracy Number
font: Stroke Font
text: Text
capHeight: Low Accuracy Number
letterSpacing: Low Accuracy Numberfloat Measure(
StrokeFont font,
string text,
float capHeight,
float letterSpacing = 0f)Parameters
| name | type | default | description |
|---|---|---|---|
| font | Stroke Font | — | |
| text | Text | — | |
| capHeight | Low Accuracy Number | — | |
| letterSpacing | Low Accuracy Number | 0 |
Returns
| result | Low Accuracy Number |
Remarks
The advance, not the ink. The Hershey faces carry side bearings and a flourish on a cursive
face reaches past them, so a caller sizing an image around the text should measure the
traced points instead.
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Stroke Pen Path
- Package
- Image Processing
Trace
FunctionThe pen path for a run of text: one polyline per pen-down..pen-up mark, in writing order,
glyph by glyph from left to right.
Signature
Trace -> IReadOnlyList<Vector2 Array>
font: Stroke Font
text: Text
capHeight: Low Accuracy Number
x: Low Accuracy Number
baseline: Low Accuracy Number
slant: Low Accuracy Number
letterSpacing: Low Accuracy NumberIReadOnlyList<Vector2[]> Trace(
StrokeFont font,
string text,
float capHeight,
float x = 0f,
float baseline = 0f,
float slant = 0f,
float letterSpacing = 0f)Parameters
| name | type | default | description |
|---|---|---|---|
| font | Stroke Font | — | The face to write with. |
| text | Text | — | The text to write. Characters the face lacks fall back to its '?'. |
| capHeight | Low Accuracy Number | — | Height from baseline to cap line, in drawing units. |
| x | Low Accuracy Number | 0 | Where the run starts. |
| baseline | Low Accuracy Number | 0 | The baseline the run sits on. |
| slant | Low Accuracy Number | 0 | Shear applied per unit of height; negative leans right, as a hand does. |
| letterSpacing | Low Accuracy Number | 0 | Extra advance after each glyph, in drawing units. |
Returns
| result | IReadOnlyList<Vector2 Array> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Stroke Pen Path
- Package
- Image Processing
Trace Glyph
FunctionThe pen path for one glyph, placed with its origin at (Origin X, Baseline).
Signature
TraceGlyph -> IReadOnlyList<Vector2 Array>
glyph: Stroke Glyph
capHeight: Low Accuracy Number
originX: Low Accuracy Number
baseline: Low Accuracy Number
slant: Low Accuracy NumberIReadOnlyList<Vector2[]> TraceGlyph(
StrokeGlyph glyph,
float capHeight,
float originX = 0f,
float baseline = 0f,
float slant = 0f)Parameters
| name | type | default | description |
|---|---|---|---|
| glyph | Stroke Glyph | — | |
| capHeight | Low Accuracy Number | — | |
| originX | Low Accuracy Number | 0 | |
| baseline | Low Accuracy Number | 0 | |
| slant | Low Accuracy Number | 0 |
Returns
| result | IReadOnlyList<Vector2 Array> |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Stroke Pen Path
- Package
- Image Processing