Shared text layout utilities (width/height calculations, mathtext helpers)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | DEFAULT_FONT_SIZE | = | 16 | |
| integer, | public, | parameter | :: | TITLE_FONT_SIZE | = | 20 | |
| integer, | public, | parameter | :: | LABEL_FONT_SIZE | = | 16 | |
| integer, | public, | parameter | :: | TICK_FONT_SIZE | = | 13 | 
Check if text contains math segments delimited by '$...$'
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | 
Calculate the pixel width of text using STB TrueType with UTF-8 support Supports mathematical notation with superscripts and subscripts
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | 
Calculate text width using a specific font size Supports mathematical notation with superscripts and subscripts
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | |||
| real(kind=wp), | intent(in) | :: | pixel_height | 
Calculate the pixel height of text using STB TrueType Supports mathematical notation with superscripts and subscripts
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | 
Calculate the descent (below baseline) portion of text in pixels
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | 
Calculate total width of mathematical text elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mathtext_element_t), | intent(in) | :: | elements(:) | |||
| real(kind=wp), | intent(in) | :: | base_font_size | 
Internal text width calculation to avoid circular dependencies
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | |||
| real(kind=wp), | intent(in) | :: | pixel_height | 
Internal text height calculation based on font metrics
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | pixel_height | 
Calculate total height of mathematical text elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mathtext_element_t), | intent(in) | :: | elements(:) | |||
| real(kind=wp), | intent(in) | :: | base_font_size | 
Remove '$' delimiters and escape '^'/'_' outside math so they render literally
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | input_text | |||
| character(len=*), | intent(out) | :: | result_text | |||
| integer, | intent(out) | :: | result_len |