- Pango::FontDescription* font = get_font_for_style (N_("MarkerText"));
-
- text = new Text (*group);
- text->property_text() = annotation.c_str();
- text->property_font_desc() = *font;
-
- delete font;
-
- if (annotate_left) {
- text->property_x() = -(text->property_text_width());
- } else {
- text->property_x() = label_offset;
- }
- text->property_y() = 0.0;
- text->property_anchor() = Gtk::ANCHOR_NW;
- text->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MarkerLabel.get();
+
+ /* setup name pixbuf sizes */
+ name_font = get_font_for_style (N_("MarkerText"));
+
+ Gtk::Label foo;
+ Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
+ int width;
+
+ layout->set_font_description (*name_font);
+ Gtkmm2ext::get_ink_pixel_size (layout, width, name_height);
+
+ name_pixbuf = new ArdourCanvas::Pixbuf(*group);
+ name_pixbuf->property_x() = label_offset;
+ name_pixbuf->property_y() = (13 / 2) - (name_height / 2);
+
+ set_name (annotation.c_str());