Add Fontconfig font search to the rich-text scheme #2400
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR builds off jk/rich-text. It doesn't modify that code at all, but introduces a method to use Fontconfig to find and create font sets.
Basically, what this does is introduce 3 main methods.
populate_font_family
) - returns a NamedTuple of Symbol styles => FTFont (Makie.NativeFont).regular
) -search_font
(:regular, :bold, :italic, :bold_italic)
are always available, even if the font has obliques instead of italics. Individual styles can still be referred to by their original names. This is theFontFamily
interface, which is, additionally, editable. It also automatically searches for a style if it can't exactly match, making it a bit more dynamic.This results in the following:
and
fonts = "TeX Gyre Heros Makie"
is equivalent tofonts = FontFamily("TeX Gyre Heros Makie")
, which is what has been provided in the default theme. This way, people can access the exact font style (Extracondensed Semibold
or what have you) as well as some basic shortcuts.Type of change
Delete options that do not apply:
Checklist