Text for vkframes: fonts (found by name on a search path, read once) and labels (text that always faces the screen).
A font is given as a file name (e.g. 'DejaVuSans.ttf', the default) or a
path. A name is looked for in, in order: the directories of the
VKFRAMES_FONT_PATH environment variable (separated by ':' or ';'), the
fonts directory of the active conda/pixi environment (where pixi installs
DejaVu), and the usual system font directories of macOS, Linux and Windows.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | VSG_BASELINE | = | 0 |
(vertical: the base line) |
| integer, | private, | parameter | :: | VSG_BOTTOM | = | 3 |
(vertical: bottom) |
| integer, | private, | parameter | :: | VSG_CENTER | = | 2 |
horizontal or vertical: center |
| integer, | private, | parameter | :: | VSG_LEFT | = | 1 |
(horizontal: left) |
| integer, | private, | parameter | :: | VSG_RIGHT | = | 3 |
(horizontal: right) |
| integer, | private, | parameter | :: | VSG_TOP | = | 1 |
(vertical: top) |
| character(len=*), | public, | parameter | :: | default_font | = | 'DejaVuSans.ttf' |
the font used when none is given |
| type(font_entry), | private, | allocatable, save | :: | fonts(:) |
Fonts read so far (each is read once; kept for the whole run). |
A font read (or looked for) by name.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(c_ptr), | public | :: | font | = | c_null_ptr |
its handle (null: not found or not read) |
|
| character(len=:), | public, | allocatable | :: | name |
the font's name as given ('' replaced by default_font) |
The path of font name (a file name or a path), or '' if not found.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
a file name or a path |
The font handle for name (found with find_font, read on first use);
the default font if name is ''; null if it cannot be found or read.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
as find_font's ('': the default font) |
A label node: text at position in color rgba, in font font_name
('' for the default), aligned by alignment (an ALIGN_* constant of
vkf_frames). size > 0: size window units tall; size < 0: -size
scene units tall, but at most max_size window units on screen. Null if
the font is missing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the label's text |
||
| real(kind=wp), | intent(in) | :: | position(3) |
(the coordinates of the node it is put under) |
||
| real(kind=wp), | intent(in) | :: | rgba(4) |
color [r, g, b, a] (0 to 1) |
||
| real(kind=wp), | intent(in) | :: | size |
0: height in window units; < 0: -height in scene units |
||
| real(kind=wp), | intent(in) | :: | max_size |
for size < 0: the largest height on screen (window units) |
||
| integer, | intent(in) | :: | alignment |
an ALIGN_* constant of vkf_frames |
||
| character(len=*), | intent(in) | :: | font_name |
font file ('' for the default) |
Change label node's position, size, maximum size and alignment (as
label_create's), in place. False on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | node |
a label_create node |
||
| real(kind=wp), | intent(in) | :: | position(3) |
as label_create's |
||
| real(kind=wp), | intent(in) | :: | size |
as label_create's |
||
| real(kind=wp), | intent(in) | :: | max_size |
as label_create's |
||
| integer, | intent(in) | :: | alignment |
an ALIGN_* constant of vkf_frames |
The horizontal and vertical alignments of vsg::StandardLayout for an ALIGN_* constant (vkf_frames: 0 left-top ... 8 right-bottom, 9 to 11 base line).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | alignment |
an ALIGN_* constant of vkf_frames |
||
| integer, | intent(out) | :: | h |
VSG_* horizontal and vertical alignments |
||
| integer, | intent(out) | :: | v |
VSG_* horizontal and vertical alignments |