Text layout, positioning and typography functions for annotations
Provides: - Text alignment and positioning algorithms - Rotation and bounds calculation - Font and typography management - Text metrics calculation with fallbacks
Calculate aligned text position based on alignment settings
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(in) | :: | text_width | |||
| real(kind=wp), | intent(in) | :: | text_height | |||
| real(kind=wp), | intent(out) | :: | adjusted_x | |||
| real(kind=wp), | intent(out) | :: | adjusted_y |
Calculate bounding box for rotated text
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(out) | :: | bounds(4) |
Safe text metrics calculation with error handling
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(out) | :: | width | |||
| real(kind=wp), | intent(out) | :: | height | |||
| logical, | intent(out) | :: | valid | |||
| character(len=*), | intent(out) | :: | error_message |
Load font system from specified path
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | font_path | |||
| logical, | intent(out) | :: | loaded | |||
| character(len=*), | intent(out) | :: | error_message |
Alias for validate_annotation_parameters for API compatibility
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| logical, | intent(out) | :: | valid | |||
| character(len=*), | intent(out) | :: | error_message |
Calculate text dimensions for given annotation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(out) | :: | width | |||
| real(kind=wp), | intent(out) | :: | height |
Calculate anchor position based on alignment settings
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(in) | :: | text_width | |||
| real(kind=wp), | intent(in) | :: | text_height | |||
| real(kind=wp), | intent(out) | :: | anchor_x | |||
| real(kind=wp), | intent(out) | :: | anchor_y |
Calculate bounding box for rotated text
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| real(kind=wp), | intent(out) | :: | bounds(4) |
Select font family with fallback mechanism
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| character(len=*), | intent(out) | :: | selected_font | |||
| logical, | intent(out) | :: | font_found |
Validate typography-specific parameters with normalization support
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(text_annotation_t), | intent(in) | :: | annotation | |||
| logical, | intent(out) | :: | valid | |||
| character(len=*), | intent(out) | :: | error_message |