Indicate UTF8 literals - fixes glyph rendering with MSVC (2/2)

This commit is contained in:
Robin Gareus 2023-01-16 21:41:22 +01:00
parent 2c7f8eeb97
commit c44b40afd7
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
17 changed files with 52 additions and 53 deletions

View File

@ -1345,12 +1345,11 @@ AudioClock::set_bbt (timecnt_t const & w)
TempoMetric m (TempoMap::use()->metric_at (pos)); TempoMetric m (TempoMap::use()->metric_at (pos));
/* UTF8 1/4 note and 1/8 note ♩ (\u2669) and ♪ (\u266a) are n/a on Windows */
if (m.tempo().note_type() == 4) { if (m.tempo().note_type() == 4) {
snprintf (buf, sizeof(buf), "\u2669 = %.3f", m.tempo().note_types_per_minute_at_DOUBLE (pos)); snprintf (buf, sizeof(buf), u8"\u2669 = %.3f", m.tempo().note_types_per_minute_at_DOUBLE (pos));
_left_btn.set_text (string_compose ("%1", buf), false); _left_btn.set_text (string_compose ("%1", buf), false);
} else if (m.tempo().note_type() == 8) { } else if (m.tempo().note_type() == 8) {
snprintf (buf, sizeof(buf), "\u266a = %.3f", m.tempo().note_types_per_minute_at_DOUBLE (pos)); snprintf (buf, sizeof(buf), u8"\u266a = %.3f", m.tempo().note_types_per_minute_at_DOUBLE (pos));
_left_btn.set_text (string_compose ("%1", buf), false); _left_btn.set_text (string_compose ("%1", buf), false);
} else { } else {
snprintf (buf, sizeof(buf), "1/%d = %.3f",m.tempo().note_type(), m.tempo().note_types_per_minute_at_DOUBLE (pos)); snprintf (buf, sizeof(buf), "1/%d = %.3f",m.tempo().note_type(), m.tempo().note_types_per_minute_at_DOUBLE (pos));

View File

@ -381,7 +381,7 @@ AutomationLine::delta_to_string (double delta) const
if (!get_uses_gain_mapping () && _desc.logarithmic) { if (!get_uses_gain_mapping () && _desc.logarithmic) {
return "x " + ARDOUR::value_as_string (_desc, delta); return "x " + ARDOUR::value_as_string (_desc, delta);
} else { } else {
return "\u0394 " + ARDOUR::value_as_string (_desc, delta); return u8"\u0394 " + ARDOUR::value_as_string (_desc, delta);
} }
} }

View File

@ -601,9 +601,9 @@ void
SequencerStepIndicator::set_text () SequencerStepIndicator::set_text ()
{ {
if (number == sv.sequencer().end_step() - 1) { if (number == sv.sequencer().end_step() - 1) {
text->set ("\u21a9"); text->set (u8"\u21a9");
} else if (number == sv.sequencer().start_step()) { } else if (number == sv.sequencer().start_step()) {
text->set ("\u21aa"); text->set (u8"\u21aa");
} else { } else {
text->set (string_compose ("%1", number+1)); text->set (string_compose ("%1", number+1));
} }

View File

@ -176,7 +176,7 @@ Editor::add_new_location_internal (Location* location)
} }
if (location->position_time_domain() == Temporal::BeatTime) { if (location->position_time_domain() == Temporal::BeatTime) {
lam->set_name ("\u266B" + location->name ()); // BEAMED EIGHTH NOTES lam->set_name (string_compose ("%1%2", u8"\u266B", location->name ())); // BEAMED EIGHTH NOTES
} }
if (location->is_hidden ()) { if (location->is_hidden ()) {
@ -228,7 +228,7 @@ Editor::location_changed (Location *location)
} }
if (location->position_time_domain() == Temporal::BeatTime) { if (location->position_time_domain() == Temporal::BeatTime) {
lam->set_name ("\u266B" + location->name ()); // BEAMED EIGHTH NOTES lam->set_name (string_compose ("%1%2", u8"\u266B", location->name ())); // BEAMED EIGHTH NOTES
} else { } else {
lam->set_name (location->name ()); lam->set_name (location->name ());
} }

View File

@ -238,7 +238,7 @@ EditorSnapshots::redisplay ()
Glib::DateTime gdt(Glib::DateTime::create_now_local (gsb.st_mtime)); Glib::DateTime gdt(Glib::DateTime::create_now_local (gsb.st_mtime));
if (_session->snap_name() == display_name) { if (_session->snap_name() == display_name) {
row[_columns.current_active] = "\u25B6"; // BLACK RIGHT-POINTING TRIANGLE row[_columns.current_active] = u8"\u25B6"; // BLACK RIGHT-POINTING TRIANGLE
} else { } else {
row[_columns.current_active] = ""; row[_columns.current_active] = "";
} }

View File

@ -685,13 +685,13 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
int max_wx = 10; int max_wx = 10;
layout->set_font_description (UIConfiguration::instance ().get_ArdourLargeFont ()); layout->set_font_description (UIConfiguration::instance ().get_ArdourLargeFont ());
layout->set_text ("\u274C"); // cross mark layout->set_text (u8"\u274C"); // cross mark
layout->get_pixel_size (w, h); layout->get_pixel_size (w, h);
max_wx = std::max (max_wx, w); max_wx = std::max (max_wx, w);
layout->set_text ("\U0001F509"); // speaker icon w/1 bar layout->set_text (u8"\U0001F509"); // speaker icon w/1 bar
layout->get_pixel_size (w, h); layout->get_pixel_size (w, h);
max_wx = std::max (max_wx, w); max_wx = std::max (max_wx, w);
layout->set_text ("\u2714"); // heavy check mark layout->set_text (u8"\u2714"); // heavy check mark
layout->get_pixel_size (w, h); layout->get_pixel_size (w, h);
max_wx = std::max (max_wx, w); max_wx = std::max (max_wx, w);
@ -768,13 +768,13 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
|| (pi->enable[1] && dbtp > pi->level[1]) || (pi->enable[1] && dbtp > pi->level[1])
) { ) {
cr->set_source_rgba (1, 0, .0, 1.0); cr->set_source_rgba (1, 0, .0, 1.0);
layout->set_text ("\u274C"); // cross mark layout->set_text (u8"\u274C"); // cross mark
} else if (lufs < pi->LUFS_range[1]) { } else if (lufs < pi->LUFS_range[1]) {
cr->set_source_rgba (.6, .7, 0, 1.0); cr->set_source_rgba (.6, .7, 0, 1.0);
layout->set_text ("\U0001F509"); // speaker icon w/1 bar layout->set_text (u8"\U0001F509"); // speaker icon w/1 bar
} else { } else {
cr->set_source_rgba (.1, 1, .1, 1.0); cr->set_source_rgba (.1, 1, .1, 1.0);
layout->set_text ("\u2714"); // heavy check mark layout->set_text (u8"\u2714"); // heavy check mark
} }
int ww, hh; int ww, hh;
layout->get_pixel_size (ww, hh); layout->get_pixel_size (ww, hh);

View File

@ -67,7 +67,7 @@ IdleOMeter::IdleOMeter ()
t->attach (*manage (new Label (_("Mean:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK); t->attach (*manage (new Label (_("Mean:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK);
t->attach (_label_avg, 1, 2, row, row + 1, FILL, SHRINK); t->attach (_label_avg, 1, 2, row, row + 1, FILL, SHRINK);
++row; ++row;
t->attach (*manage (new Label (_("\u03c3:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK); t->attach (*manage (new Label (_(u8"\u03c3:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK);
t->attach (_label_dev, 1, 2, row, row + 1, FILL, SHRINK); t->attach (_label_dev, 1, 2, row, row + 1, FILL, SHRINK);
++row; ++row;
t->attach (*manage (new Label (_("Elapsed:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK); t->attach (*manage (new Label (_("Elapsed:"), ALIGN_END)), 0, 1, row, row + 1, FILL, SHRINK);

View File

@ -145,7 +145,7 @@ InstrumentSelector::build_instrument_list()
uint32_t n_outs = p->max_configurable_outputs (); uint32_t n_outs = p->max_configurable_outputs ();
if (n_outs > 2) { if (n_outs > 2) {
if (p->reconfigurable_io ()) { if (p->reconfigurable_io ()) {
suffix = string_compose(_("\u2264 %1 outs"), n_outs); suffix = string_compose(_(u8"\u2264 %1 outs"), n_outs);
} else { } else {
suffix = string_compose(_("%1 outs"), n_outs); suffix = string_compose(_("%1 outs"), n_outs);
} }
@ -155,7 +155,7 @@ InstrumentSelector::build_instrument_list()
uint32_t n_outs = p->max_configurable_outputs (); uint32_t n_outs = p->max_configurable_outputs ();
if (n_outs > 2) { if (n_outs > 2) {
if (p->reconfigurable_io ()) { if (p->reconfigurable_io ()) {
suffix = string_compose(_("\u2264 %1 outs"), n_outs); suffix = string_compose(_(u8"\u2264 %1 outs"), n_outs);
} else { } else {
suffix = string_compose(_("%1 outs"), n_outs); suffix = string_compose(_("%1 outs"), n_outs);
} }

View File

@ -407,7 +407,7 @@ IOButtonBase::set_label (IOButtonBase& self, ARDOUR::Session& session, boost::sh
} }
if (total_connection_count > typed_connection_count) { if (total_connection_count > typed_connection_count) {
label << "\u2295"; /* circled plus */ label << u8"\u2295"; /* circled plus */
} }
self.set_text (label.str ()); self.set_text (label.str ());

View File

@ -774,7 +774,7 @@ LoudnessDialog::calculate_gain ()
_gain_norm_label.set_text (string_compose (_("%1 dB"), std::setprecision (2), std::showpos, std::fixed, _gain_norm)); _gain_norm_label.set_text (string_compose (_("%1 dB"), std::setprecision (2), std::showpos, std::fixed, _gain_norm));
if (!in_range) { if (!in_range) {
_gain_exceeds_label.set_text (_("exceeds")); _gain_exceeds_label.set_text (_("exceeds"));
_gain_total_label.set_markup (_("<b> \u00B140 dB</b>")); _gain_total_label.set_markup (_(u8"<b> \u00B140 dB</b>"));
} else { } else {
_gain_exceeds_label.set_text (X_("")); _gain_exceeds_label.set_text (X_(""));
_gain_total_label.set_markup (string_compose (_("<b>%1 dB</b>"), std::setw (7), std::setprecision (2), std::showpos, std::fixed, gain_db ())); _gain_total_label.set_markup (string_compose (_("<b>%1 dB</b>"), std::setw (7), std::setprecision (2), std::showpos, std::fixed, gain_db ()));
@ -819,21 +819,21 @@ LoudnessDialog::test_conformity ()
|| (preset.enable[0] && dbfs > preset.level[0]) || (preset.enable[0] && dbfs > preset.level[0])
|| (preset.enable[1] && dbtp > preset.level[1]) || (preset.enable[1] && dbtp > preset.level[1])
) { ) {
l = manage (new Label ("\u274C", ALIGN_CENTER)); // cross mark l = manage (new Label (u8"\u274C", ALIGN_CENTER)); // cross mark
l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ()); l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ());
l->modify_fg (Gtk::STATE_NORMAL, color_fail); l->modify_fg (Gtk::STATE_NORMAL, color_fail);
set_tooltip (*l, "The signal is too loud."); set_tooltip (*l, "The signal is too loud.");
} else if (lufs_i < preset.LUFS_range[1]) { } else if (lufs_i < preset.LUFS_range[1]) {
l = manage (new Label ("\U0001F509", ALIGN_CENTER)); // speaker icon w/1 bar l = manage (new Label (u8"\U0001F509", ALIGN_CENTER)); // speaker icon w/1 bar
l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ()); l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ());
l->modify_fg (Gtk::STATE_NORMAL, color_warn); l->modify_fg (Gtk::STATE_NORMAL, color_warn);
set_tooltip (*l, "The signal is too quiet, but satisfies the max. loudness spec."); set_tooltip (*l, "The signal is too quiet, but satisfies the max. loudness spec.");
} else { } else {
l = manage (new Label ("\u2714", ALIGN_CENTER)); // heavy check mark l = manage (new Label (u8"\u2714", ALIGN_CENTER)); // heavy check mark
l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ()); l->modify_font (UIConfiguration::instance ().get_ArdourBigFont ());
l->modify_fg (Gtk::STATE_NORMAL, color_good); l->modify_fg (Gtk::STATE_NORMAL, color_good);
set_tooltip (*l, "Signal loudness is within the spec."); set_tooltip (*l, "Signal loudness is within the spec.");
Gtkmm2ext::set_size_request_to_display_given_text (*l, "\u274C\u2713", 0, 0); Gtkmm2ext::set_size_request_to_display_given_text (*l, u8"\u274C\u2713", 0, 0);
} }
t->attach (*l, col + 1, col + 2, row, row + 1, SHRINK, SHRINK, 2, 0); t->attach (*l, col + 1, col + 2, row, row + 1, SHRINK, SHRINK, 2, 0);

View File

@ -150,7 +150,7 @@ PluginEqGui::PluginEqGui (boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
// Freq/dB info for mouse over // Freq/dB info for mouse over
_pointer_info = new Gtk::Label ("", 1, 0.5); _pointer_info = new Gtk::Label ("", 1, 0.5);
_pointer_info->set_name ("PluginAnalysisInfoLabel"); _pointer_info->set_name ("PluginAnalysisInfoLabel");
Gtkmm2ext::set_size_request_to_display_given_text (*_pointer_info, "10.0kHz_000.0dB_180.0\u00B0", 0, 0); Gtkmm2ext::set_size_request_to_display_given_text (*_pointer_info, u8"10.0kHz_000.0dB_180.0\u00B0", 0, 0);
// populate table // populate table
attach (*manage(_analysis_area), 0, 4, 0, 1); attach (*manage(_analysis_area), 0, 4, 0, 1);
@ -507,7 +507,7 @@ PluginEqGui::update_pointer_info( float x)
if (_phase_button->get_active ()) { if (_phase_button->get_active ()) {
float phase = 180. * _impulse_fft->phase_at_bin (i) / M_PI; float phase = 180. * _impulse_fft->phase_at_bin (i) / M_PI;
ss << " " << std::setw (6) << std::setprecision (1) << std::showpos << phase; ss << " " << std::setw (6) << std::setprecision (1) << std::showpos << phase;
ss << std::setw (0) << "\u00B0"; ss << std::setw (0) << u8"\u00B0";
} }
_pointer_info->set_text (ss.str()); _pointer_info->set_text (ss.str());
} }
@ -625,9 +625,9 @@ PluginEqGui::draw_scales_phase (Gtk::Widget*, cairo_t *cr)
cairo_set_source_rgb (cr, .8, .9, 0.2); cairo_set_source_rgb (cr, .8, .9, 0.2);
if (i == 0) { if (i == 0) {
snprintf (buf,256, "0\u00b0"); snprintf (buf,256, u8"0\u00b0");
} else { } else {
snprintf (buf,256, "%d\u00b0", (i * 45)); snprintf (buf,256, u8"%d\u00b0", (i * 45));
} }
cairo_text_extents (cr, buf, &t_ext); cairo_text_extents (cr, buf, &t_ext);
cairo_move_to (cr, _analysis_width - t_ext.width - t_ext.x_bearing - 2.0, y - extents.descent); cairo_move_to (cr, _analysis_width - t_ext.width - t_ext.x_bearing - 2.0, y - extents.descent);
@ -648,7 +648,7 @@ PluginEqGui::draw_scales_phase (Gtk::Widget*, cairo_t *cr)
y = _analysis_height / 2.0 + (float)i * (_analysis_height / 8.0) * PHASE_PROPORTION; y = _analysis_height / 2.0 + (float)i * (_analysis_height / 8.0) * PHASE_PROPORTION;
// label // label
snprintf (buf,256, "-%d\u00b0", (i * 45)); snprintf (buf,256, u8"-%d\u00b0", (i * 45));
cairo_set_source_rgb (cr, .8, .9, 0.2); cairo_set_source_rgb (cr, .8, .9, 0.2);
cairo_text_extents (cr, buf, &t_ext); cairo_text_extents (cr, buf, &t_ext);
cairo_move_to (cr, _analysis_width - t_ext.width - t_ext.x_bearing - 2.0, y - extents.descent); cairo_move_to (cr, _analysis_width - t_ext.width - t_ext.x_bearing - 2.0, y - extents.descent);

View File

@ -771,14 +771,14 @@ RegionView::make_name () const
// XXX nice to have some good icons for this // XXX nice to have some good icons for this
if (_region->position_time_domain() == Temporal::BeatTime) { if (_region->position_time_domain() == Temporal::BeatTime) {
str += "\u266B"; // BEAMED EIGHTH NOTES str += u8"\u266B"; // BEAMED EIGHTH NOTES
} }
if (_region->locked()) { if (_region->locked()) {
str += "\u2629"; // CROSS OF JERUSALEM str += u8"\u2629"; // CROSS OF JERUSALEM
str += _region->name(); str += _region->name();
} else if (_region->position_locked()) { } else if (_region->position_locked()) {
str += "\u21B9"; // LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR str += u8"\u21B9"; // LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
str += _region->name(); str += _region->name();
} else if (_region->video_locked()) { } else if (_region->video_locked()) {
str += '['; str += '[';
@ -789,7 +789,7 @@ RegionView::make_name () const
} }
if (_region->muted()) { if (_region->muted()) {
str = std::string("\U0001F507") + str; // SPEAKER WITH CANCELLATION STROKE str = std::string(u8"\U0001F507") + str; // SPEAKER WITH CANCELLATION STROKE
} }
return str; return str;

View File

@ -366,7 +366,7 @@ SoundFileBox::setup_labels (const string& filename)
case 1: { case 1: {
Evoral::SMF::Tempo* t = smf.nth_tempo (0); Evoral::SMF::Tempo* t = smf.nth_tempo (0);
assert (t); assert (t);
tempomap_value.set_text (string_compose (_("%1/%2 \u2669 = %3"), tempomap_value.set_text (string_compose (_(u8"%1/%2 \u2669 = %3"),
t->numerator, t->numerator,
t->denominator, t->denominator,
t->tempo ())); t->tempo ()));

View File

@ -191,24 +191,24 @@ StepEntry::StepEntry ()
note_velocity_box.pack_start (velocity_fff_button, false, false); note_velocity_box.pack_start (velocity_fff_button, false, false);
/* https://www.unicode.org/charts/PDF/U1D100.pdf */ /* https://www.unicode.org/charts/PDF/U1D100.pdf */
velocity_ppp_button.set_text ("\U0001D18F\U0001D18F\U0001D18F"); //MUSICAL SYMBOL PIANO (U+1D18F) velocity_ppp_button.set_text (u8"\U0001D18F\U0001D18F\U0001D18F"); //MUSICAL SYMBOL PIANO (U+1D18F)
velocity_pp_button.set_text ("\U0001D18F\U0001D18F"); velocity_pp_button.set_text (u8"\U0001D18F\U0001D18F");
velocity_p_button.set_text ("\U0001D18F"); velocity_p_button.set_text (u8"\U0001D18F");
velocity_mp_button.set_text ("\U0001D190\U0001D18F"); //MUSICAL SYMBOL MEZZO (U+1D190) velocity_mp_button.set_text (u8"\U0001D190\U0001D18F"); //MUSICAL SYMBOL MEZZO (U+1D190)
velocity_mf_button.set_text ("\U0001D190\U0001D191"); velocity_mf_button.set_text (u8"\U0001D190\U0001D191");
velocity_f_button.set_text ("\U0001D191"); // MUSICAL SYMBOL FORTE (U+1D191) velocity_f_button.set_text (u8"\U0001D191"); // MUSICAL SYMBOL FORTE (U+1D191)
velocity_ff_button.set_text ("\U0001D191\U0001D191"); velocity_ff_button.set_text (u8"\U0001D191\U0001D191");
velocity_fff_button.set_text ("\U0001D191\U0001D191\U0001D191"); velocity_fff_button.set_text (u8"\U0001D191\U0001D191\U0001D191");
length_1_button.set_text ("\U0001D15D"); // MUSICAL SYMBOL WHOLE NOTE length_1_button.set_text (u8"\U0001D15D"); // MUSICAL SYMBOL WHOLE NOTE
length_2_button.set_text ("\U0001D15E"); // MUSICAL SYMBOL HALF NOTE length_2_button.set_text (u8"\U0001D15E"); // MUSICAL SYMBOL HALF NOTE
length_4_button.set_text ("\U0001D15F"); // MUSICAL SYMBOL QUARTER NOTE length_4_button.set_text (u8"\U0001D15F"); // MUSICAL SYMBOL QUARTER NOTE
length_8_button.set_text ("\U0001D160"); // MUSICAL SYMBOL EIGHTH NOTE length_8_button.set_text (u8"\U0001D160"); // MUSICAL SYMBOL EIGHTH NOTE
length_16_button.set_text ("\U0001D161"); // MUSICAL SYMBOL SIXTEENTH NOTE length_16_button.set_text (u8"\U0001D161"); // MUSICAL SYMBOL SIXTEENTH NOTE
length_32_button.set_text ("\U0001D162"); // MUSICAL SYMBOL THIRTY-SECOND NOTE length_32_button.set_text (u8"\U0001D162"); // MUSICAL SYMBOL THIRTY-SECOND NOTE
length_64_button.set_text ("\U0001D163"); // MUSICAL SYMBOL SIXTY-FOURTH NOTE length_64_button.set_text (u8"\U0001D163"); // MUSICAL SYMBOL SIXTY-FOURTH NOTE
chord_button.set_text ("\U0001D1D6"); // MUSICAL SYMBOL SCANDICUS (customized in ArdourSans) chord_button.set_text (u8"\U0001D1D6"); // MUSICAL SYMBOL SCANDICUS (customized in ArdourSans)
Label* l = manage (new Label); Label* l = manage (new Label);
l->set_markup ("<b><big>-</big></b>"); l->set_markup ("<b><big>-</big></b>");

View File

@ -566,7 +566,7 @@ TransportMastersWidget::Row::update (Session* s, samplepos_t now)
} }
string current_str (" --:--:--:--"); string current_str (" --:--:--:--");
string delta_str ("\u0394 ---- "); string delta_str (u8"\u0394 ---- ");
string age_str (" "); string age_str (" ");
if (tm->speed_and_position (speed, pos, most_recent, when, now)) { if (tm->speed_and_position (speed, pos, most_recent, when, now)) {

View File

@ -193,7 +193,7 @@ TriggerMaster::render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Cont
snprintf (font_name, sizeof (font_name), "ArdourSans %d", font_size); snprintf (font_name, sizeof (font_name), "ArdourSans %d", font_size);
Pango::FontDescription pfd (font_name); Pango::FontDescription pfd (font_name);
layout->set_font_description (pfd); layout->set_font_description (pfd);
layout->set_text ("\u266b"); layout->set_text (u8"\u266b");
int tw, th; int tw, th;
layout->get_pixel_size (tw, th); layout->get_pixel_size (tw, th);
context->move_to (width / 2, height / 2); context->move_to (width / 2, height / 2);

View File

@ -761,7 +761,7 @@ ARDOUR_UI_UTILS::samples_as_time_string (samplecnt_t s, float rate, bool show_sa
snprintf (buf, sizeof (buf), "%" PRId64" spl", s); snprintf (buf, sizeof (buf), "%" PRId64" spl", s);
} else if (s < (rate / 1000.f)) { } else if (s < (rate / 1000.f)) {
/* 0 .. 999 usec */ /* 0 .. 999 usec */
snprintf (buf, sizeof (buf), "%.0f \u00B5s", s * 1e+6f / rate); snprintf (buf, sizeof (buf), u8"%.0f \u00B5s", s * 1e+6f / rate);
} else if (s < (rate / 100.f)) { } else if (s < (rate / 100.f)) {
/* 1.000 .. 9.999 ms */ /* 1.000 .. 9.999 ms */
snprintf (buf, sizeof (buf), "%.3f ms", s * 1e+3f / rate); snprintf (buf, sizeof (buf), "%.3f ms", s * 1e+3f / rate);