Add API to force ArdourSans font (for UTF8 symbols)
This commit is contained in:
parent
e8a87f31fc
commit
ef6803abd1
@ -115,6 +115,7 @@ public:
|
||||
#undef UI_CONFIG_VARIABLE
|
||||
#define CANVAS_FONT_VARIABLE(var,name) \
|
||||
Pango::FontDescription get_##var () const { return ARDOUR_UI_UTILS::sanitized_font (var.get()); } \
|
||||
Pango::FontDescription get_Ardour##var () const { return ARDOUR_UI_UTILS::ardour_font (var.get()); } \
|
||||
bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; }
|
||||
#include "canvas_vars.h"
|
||||
#undef CANVAS_FONT_VARIABLE
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -75,6 +75,7 @@ unsigned char* xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h);
|
||||
ArdourCanvas::Points* get_canvas_points (std::string who, uint32_t npoints);
|
||||
|
||||
Pango::FontDescription sanitized_font (std::string const&);
|
||||
Pango::FontDescription ardour_font (std::string const&);
|
||||
Pango::FontDescription get_font_for_style (std::string widgetname);
|
||||
|
||||
void decorate (Gtk::Window& w, Gdk::WMDecoration d);
|
||||
|
Loading…
Reference in New Issue
Block a user