Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow FTFont in TextConfig(font=...) #202

Merged
merged 4 commits into from
Feb 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/outputs/textconfig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Text configuration for printing timestep and grid name on the image.

# Arguments / Keywords

- `font`: `String` font name.
- `font`: `FreeTypeAbstraction.FTFont` (direct), or `String` (font name to look for).
ederag marked this conversation as resolved.
Show resolved Hide resolved
- `namepixels` and `timepixels`: the pixel size of the font.
- `timepos` and `namepos`: tuples that set the label positions, in `Int` pixels.
- `fcolor` and `bcolor`: the foreground and background colors, as `ARGB32`.
Expand All @@ -28,7 +28,9 @@ function TextConfig(;
timepos=(2timepixels, timepixels),
fcolor=ARGB32(1.0), bcolor=ZEROCOL,
)
if font isa AbstractString
if font isa FreeTypeAbstraction.FTFont
face = font
elseif font isa AbstractString
face = FreeTypeAbstraction.findfont(font)
face isa Nothing && _fontnotfounderror(font)
else
Expand Down