API Reference
Class
LabelPlacementService
Places labels with the same font resolution and shaping used by PNG text, with a bounded measurement cache.
Inheritance
- Object
- LabelPlacementService
Remarks
For the same fonts and input order, placement is deterministic. Unresolvable fonts use portable measurements. Intersections with other labels and marks are rejected. Intentional containment in an associated mark is allowed.
Constructors
public LabelPlacementService() #Methods
public TextMetrics Measure(String text, TextStyle style) #Returns:
TextMetricsMeasures shaped text with real font metrics, or a portable estimate if no font is available.
Parameters
- text System.String
- style ChartForgeX.Typography.TextStyle
public IReadOnlyList<PlacedLabel> Place(IReadOnlyList<LabelPlacementRequest> requests, ChartRect bounds, IReadOnlyList<LabelObstacle>? obstacles = null, Double gap = 2) #Returns:
IReadOnlyList<PlacedLabel>Places a complete scene, returning results in the original request order.
Parameters
- requests System.Collections.Generic.IReadOnlyList<ChartForgeX.Rendering.LabelPlacementRequest>
- Label requests in stable input order.
- bounds ChartForgeX.Primitives.ChartRect
- The usable scene rectangle.
- obstacles System.Collections.Generic.IReadOnlyList<ChartForgeX.Rendering.LabelObstacle>? = null
- Mark rectangles to avoid.
- gap System.Double = 2
- Minimum separation in logical pixels.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?