fortplot_annotation_types Module

Type definitions and basic operations for text annotations

Provides: - Annotation type definitions with all properties - Coordinate system constants - Creation and destruction functions - Basic validation functions



Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: COORD_DATA = 1
integer, public, parameter :: COORD_FIGURE = 2
integer, public, parameter :: COORD_AXIS = 3

Derived Types

type, public ::  annotation_color_t

Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: r = 0.0_wp
real(kind=wp), public :: g = 0.0_wp
real(kind=wp), public :: b = 0.0_wp
real(kind=wp), public :: a = 1.0_wp

type, public ::  text_annotation_t

Components

Type Visibility Attributes Name Initial
character(len=256), public :: text = ""
real(kind=wp), public :: x = 0.0_wp
real(kind=wp), public :: y = 0.0_wp
integer, public :: coord_type = COORD_DATA
logical, public :: validated = .false.
logical, public :: valid = .true.
real(kind=wp), public :: font_size = 12.0_wp
real(kind=wp), public :: rotation = 0.0_wp
character(len=16), public :: alignment = 'left'
character(len=16), public :: ha = 'left'
character(len=16), public :: va = 'bottom'
character(len=64), public :: font_family = 'DejaVu Sans'
character(len=16), public :: weight = 'normal'
character(len=16), public :: style = 'normal'
real(kind=wp), public :: color(3) = [0.0_wp, 0.0_wp, 0.0_wp]
real(kind=wp), public :: alpha = 1.0_wp
logical, public :: has_bbox = .false.
logical, public :: bbox = .false.
type(annotation_color_t), public :: bbox_color = annotation_color_t(1.0_wp, 1.0_wp, 1.0_wp, 1.0_wp)
logical, public :: has_arrow = .false.
real(kind=wp), public :: arrow_x = 0.0_wp
real(kind=wp), public :: arrow_y = 0.0_wp
integer, public :: arrow_coord_type = COORD_DATA
real(kind=wp), public :: xytext_x = 0.0_wp
real(kind=wp), public :: xytext_y = 0.0_wp
integer, public :: xytext_coord_type = COORD_DATA
character(len=64), public :: arrowstyle = ''

Functions

public function create_text_annotation(text, x, y, coord_type) result(annotation)

Create a text annotation with specified properties

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y
integer, intent(in), optional :: coord_type

Return Value type(text_annotation_t)


Subroutines

public subroutine destroy_text_annotation(annotation)

Clean up text annotation resources

Arguments

Type IntentOptional Attributes Name
type(text_annotation_t), intent(inout) :: annotation

public subroutine validate_annotation_coordinates(annotation, valid, error_message)

Validate annotation coordinate values

Arguments

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

public subroutine validate_annotation_parameters(annotation, valid, error_message)

Validate annotation parameter values

Arguments

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

public subroutine validate_annotation(annotation, valid, error_message)

Comprehensive annotation validation combining coordinate and parameter checks

Arguments

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