Mathematical text rendering with superscripts and subscripts
Supports matplotlib-like syntax: x^2, y_i, x_{text}, y^{superscript}
Variables
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
integer,
|
public, |
parameter
|
:: |
ELEMENT_NORMAL |
= |
0 |
|
|
integer,
|
public, |
parameter
|
:: |
ELEMENT_SUPERSCRIPT |
= |
1 |
|
|
integer,
|
public, |
parameter
|
:: |
ELEMENT_SUBSCRIPT |
= |
2 |
|
|
integer,
|
public, |
parameter
|
:: |
ELEMENT_SQRT |
= |
3 |
|
Derived Types
Components
| Type |
Visibility | Attributes |
|
Name |
| Initial | |
|
character(len=:),
|
public, |
allocatable
|
:: |
text |
|
|
|
|
integer,
|
public |
|
:: |
element_type |
= |
ELEMENT_NORMAL |
|
|
real(kind=wp),
|
public |
|
:: |
font_size_ratio |
= |
1.0_wp |
|
|
real(kind=wp),
|
public |
|
:: |
vertical_offset |
= |
0.0_wp |
|
Functions
Parse mathematical text into renderable elements
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
character(len=*),
|
intent(in) |
|
|
:: |
input_text |
|
Return Value
type(mathtext_element_t), allocatable, (:)
Calculate total width of mathematical text elements
This function signature is used by text_rendering but implementation moved there
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mathtext_element_t),
|
intent(in) |
|
|
:: |
elements(:) |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
base_font_size |
|
Return Value
integer
Calculate total height of mathematical text elements
This function signature is used by text_rendering but implementation moved there
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
type(mathtext_element_t),
|
intent(in) |
|
|
:: |
elements(:) |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
base_font_size |
|
Return Value
integer
Subroutines
Render mathematical text elements to image
This function signature is used by text_rendering but implementation moved there
Arguments
| Type |
Intent | Optional | Attributes |
|
Name |
|
|
integer(kind=1),
|
intent(inout) |
|
|
:: |
image_data(*) |
|
|
integer,
|
intent(in) |
|
|
:: |
width |
|
|
integer,
|
intent(in) |
|
|
:: |
height |
|
|
integer,
|
intent(in) |
|
|
:: |
x |
|
|
integer,
|
intent(in) |
|
|
:: |
y |
|
|
type(mathtext_element_t),
|
intent(in) |
|
|
:: |
elements(:) |
|
|
integer(kind=1),
|
intent(in) |
|
|
:: |
r |
|
|
integer(kind=1),
|
intent(in) |
|
|
:: |
g |
|
|
integer(kind=1),
|
intent(in) |
|
|
:: |
b |
|
|
real(kind=wp),
|
intent(in) |
|
|
:: |
base_font_size |
|