Add API to force ArdourSans font (for UTF8 symbols)

This commit is contained in:
Robin Gareus 2022-11-07 11:55:16 +01:00
parent e8a87f31fc
commit ef6803abd1
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 18 additions and 0 deletions

View file

@ -284,6 +284,22 @@ ARDOUR_UI_UTILS::sanitized_font (std::string const& name)
return fd;
}
Pango::FontDescription
ARDOUR_UI_UTILS::ardour_font (std::string const& name)
{
Pango::FontDescription fd (name);
if (!fd.get_family().empty() && fd.get_family().find ("Mon") != std::string::npos) {
/* matches "ArdourMono", "Monaco" */
fd.set_family ("ArdourMono");
} else {
fd.set_family ("ArdourSans");
}
return fd;
}
Pango::FontDescription
ARDOUR_UI_UTILS::get_font_for_style (string widgetname)
{