So far, pango font size has been calculated using truncation. Since
the calculation of font size may involve conversion of magnifications
to font-size and back, numerical errors can easily throw the
calculation slightly off. For that reason, rounding is the
appropriate option here.
#include "dimensions.hh"
#include "all-font-metrics.hh"
+#include "libc-extension.hh"
#include "output-def.hh"
#include "pango-font.hh"
0.0);
Real size = text_size * pow (2.0, step / 6.0);
- pango_font_description_set_size (description, gint (size * PANGO_SCALE));
+ pango_font_description_set_size (description,
+ gint (my_round (size * PANGO_SCALE)));
return description;
}
*/
#include "dimensions.hh"
+#include "libc-extension.hh"
#include "output-def.hh"
#include "modified-font-metric.hh"
#include "pango-font.hh"
PangoFontDescription *description
= pango_font_description_from_string (scm_i_string_chars (descr));
- pango_font_description_set_size (description,
- gint (factor *
- pango_font_description_get_size (description)));
+ pango_font_description_set_size
+ (description,
+ gint (my_round (factor * pango_font_description_get_size (description))));
Font_metric *fm = all_fonts_global->find_pango_font (description,
output_scale (layout));