fortplot_annotation_layout Module

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



Subroutines

public subroutine calculate_aligned_position(annotation, text_width, text_height, adjusted_x, adjusted_y)

Calculate aligned text position based on alignment settings

Arguments

Type IntentOptional 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

public subroutine calculate_rotated_bounds(annotation, bounds)

Calculate bounding box for rotated text

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
real(kind=wp), intent(out) :: bounds(4)

public subroutine calculate_text_metrics_safe(annotation, width, height, valid, error_message)

Safe text metrics calculation with error handling

Arguments

Type IntentOptional 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

public subroutine load_font_system(font_path, loaded, error_message)

Load font system from specified path

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: font_path
logical, intent(out) :: loaded
character(len=*), intent(out) :: error_message

public subroutine validate_text_parameters(annotation, valid, error_message)

Alias for validate_annotation_parameters for API compatibility

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
logical, intent(out) :: valid
character(len=*), intent(out) :: error_message

public subroutine calculate_text_metrics(annotation, width, height)

Calculate text dimensions for given annotation

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
real(kind=wp), intent(out) :: width
real(kind=wp), intent(out) :: height

public subroutine calculate_text_anchor(annotation, text_width, text_height, anchor_x, anchor_y)

Calculate anchor position based on alignment settings

Arguments

Type IntentOptional 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

public subroutine calculate_rotated_text_bounds(annotation, bounds)

Calculate bounding box for rotated text

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
real(kind=wp), intent(out) :: bounds(4)

public subroutine select_font_family(annotation, selected_font, font_found)

Select font family with fallback mechanism

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
character(len=*), intent(out) :: selected_font
logical, intent(out) :: font_found

public subroutine validate_typography_parameters(annotation, valid, error_message)

Validate typography-specific parameters with normalization support

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(in) :: annotation
logical, intent(out) :: valid
character(len=*), intent(out) :: error_message