Utility functions for working with annotations (measuring text, drawing shapes, input normalization and more)
Methods
-
<static> calculateAutoFontSize(freeTextSubset)
-
Calculates an automatic font size for a FreeText annotation using its smallest quad height
Parameters:
Name Type Description freeTextSubsetCore.Annotations.Utilities.FreeTextSubset Minimal FreeText data used for sizing Returns:
Auto font size (string with "pt" suffix when adjusted)- Type
- string | number
-
<static> setAnnotationSubjectHandler(func)
-
Overrides the internal annotation subject resolution logic
Parameters:
Name Type Description funcCore.Annotations.Utilities.AnnotationSubjectHandler Callback receiving a type and returning a subject string
Type Definitions
-
AnnotationSubjectHandler(type)
-
Callback used to resolve a user‑facing subject string for an annotation type
Parameters:
Name Type Description typestring Internal annotation type key (e.g. 'arrow', 'callout', 'freetext', 'polygon') Returns:
Subject string to display (e.g. 'Arrow', 'FreeText', 'Polygon')- Type
- string
-
FreeTextSubset
-
Type:
- Object
Properties:
Name Type Argument Description FontSizestring | number Base font size for the annotation (e.g., 12 or "12pt") QuadsArray.<{y1: number, y3: number}> <optional>
Annotation quads; the smallest y1 - y3 is used to derive the max allowable font size