From 58f1d46e319b58319ec7ca2a60e693f96333b01e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 23 Jan 2025 18:58:10 +0100 Subject: [PATCH] One font to rule the rulers. Remove bold fonts for Bar/beats and font-size inconsistency on macOS (VerySmall, SmallBold). This reverts commit e3dc0a24f28620b9cbbfd94a35dcede73560f83d. and 14318dd342bbb16c43e2e532e33beea17251fb11 and a76afae0e9ffa8a44311d6f9c1d8dbc613bfc089 and 7c27f617dc91692627c6b0cf3712f7662529b594 and 20029ec7e6b7a2c36464f295dfe120ea04d334c7 --- gtk2_ardour/editor_rulers.cc | 2 -- gtk2_ardour/pianoroll.cc | 1 - libs/canvas/canvas/ruler.h | 2 -- libs/canvas/ruler.cc | 16 +--------------- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 36e7abfde7..8a7bfd822a 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -139,7 +139,6 @@ Editor::initialize_rulers () #else Pango::FontDescription font (UIConfiguration::instance().get_SmallFont()); #endif - Pango::FontDescription larger_font (UIConfiguration::instance().get_SmallBoldFont()); _timecode_metric = new TimecodeMetric (this); _bbt_metric = new BBTMetric (this); @@ -166,7 +165,6 @@ Editor::initialize_rulers () bbt_ruler = new ArdourCanvas::Ruler (_time_markers_group, _bbt_metric, ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, timebar_height)); bbt_ruler->set_font_description (font); - bbt_ruler->set_second_font_description (larger_font); CANVAS_DEBUG_NAME (bbt_ruler, "bbt ruler"); timecode_nmarks = 0; diff --git a/gtk2_ardour/pianoroll.cc b/gtk2_ardour/pianoroll.cc index 0ed3e3dd00..5479f25892 100644 --- a/gtk2_ardour/pianoroll.cc +++ b/gtk2_ardour/pianoroll.cc @@ -386,7 +386,6 @@ Pianoroll::build_canvas () Pango::FontDescription larger_font (UIConfiguration::instance().get_SmallBoldFont()); bbt_ruler = new ArdourCanvas::Ruler (time_line_group, &bbt_metric, ArdourCanvas::Rect (0, timebar_height * 2, ArdourCanvas::COORD_MAX, timebar_height * 3)); bbt_ruler->set_font_description (font); - bbt_ruler->set_second_font_description (larger_font); Gtkmm2ext::Color base = UIConfiguration::instance().color ("ruler base"); Gtkmm2ext::Color text = UIConfiguration::instance().color ("ruler text"); bbt_ruler->set_fill_color (base); diff --git a/libs/canvas/canvas/ruler.h b/libs/canvas/canvas/ruler.h index ec1656e1fd..c17084db85 100644 --- a/libs/canvas/canvas/ruler.h +++ b/libs/canvas/canvas/ruler.h @@ -67,7 +67,6 @@ public: void set_range (int64_t lower, int64_t upper); void set_font_description (Pango::FontDescription); - void set_second_font_description (Pango::FontDescription); void set_metric (const Metric *); void render (Rect const & area, Cairo::RefPtr) const; @@ -86,7 +85,6 @@ private: Gtkmm2ext::Color _divider_color_bottom; Pango::FontDescription* _font_description; - Pango::FontDescription* _second_font_description; mutable std::vector marks; mutable bool _need_marks; }; diff --git a/libs/canvas/ruler.cc b/libs/canvas/ruler.cc index 96f8d9f6d0..e426e8b61b 100644 --- a/libs/canvas/ruler.cc +++ b/libs/canvas/ruler.cc @@ -38,7 +38,6 @@ Ruler::Ruler (Canvas* c, const Metric* m) , _upper (0) , _divide_height (-1.0) , _font_description (0) - , _second_font_description (0) , _need_marks (true) { } @@ -50,7 +49,6 @@ Ruler::Ruler (Canvas* c, const Metric* m, Rect const& r) , _upper (0) , _divide_height (-1.0) , _font_description (0) - , _second_font_description (0) , _need_marks (true) { } @@ -62,7 +60,6 @@ Ruler::Ruler (Item* parent, const Metric* m) , _upper (0) , _divide_height (-1.0) , _font_description (0) - , _second_font_description (0) , _need_marks (true) { } @@ -74,7 +71,6 @@ Ruler::Ruler (Item* parent, const Metric* m, Rect const& r) , _upper (0) , _divide_height (-1.0) , _font_description (0) - , _second_font_description (0) , _need_marks (true) { } @@ -98,16 +94,6 @@ Ruler::set_font_description (Pango::FontDescription fd) end_visual_change (); } -void -Ruler::set_second_font_description (Pango::FontDescription fd) -{ - begin_visual_change (); - delete _second_font_description; - _second_font_description = new Pango::FontDescription (fd); - end_visual_change (); -} - - void Ruler::render (Rect const & area, Cairo::RefPtr cr) const { @@ -167,7 +153,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const for (vector::const_iterator m = marks.begin(); m != marks.end(); ++m) { Duple pos; - Pango::FontDescription* fd = (m->style == Mark::Major) ? (_second_font_description ? _second_font_description : _font_description) : _font_description; + Pango::FontDescription* fd = _font_description; pos.x = round (m->position/_metric->units_per_pixel) + self.x0; pos.y = self.y1; /* bottom edge */