diff --git a/util/font-options.hh b/util/font-options.hh index fa1cffa86..8b59c9681 100644 --- a/util/font-options.hh +++ b/util/font-options.hh @@ -58,6 +58,7 @@ struct font_options_t : face_options_t int x_ppem = 0; int y_ppem = 0; double ptem = 0.; + double slant = 0.; unsigned int subpixel_bits = SUBPIXEL_BITS; mutable double font_size_x = DEFAULT_FONT_SIZE; mutable double font_size_y = DEFAULT_FONT_SIZE; @@ -94,6 +95,8 @@ font_options_t::post_parse (GError **error) hb_font_set_ppem (font, x_ppem, y_ppem); hb_font_set_ptem (font, ptem); + hb_font_set_synthetic_slant (font, slant); + int scale_x = (int) scalbnf (font_size_x, subpixel_bits); int scale_y = (int) scalbnf (font_size_y, subpixel_bits); hb_font_set_scale (font, scale_x, scale_y); @@ -265,6 +268,8 @@ font_options_t::add_options (option_parser_t *parser) G_OPTION_ARG_CALLBACK, (gpointer) &parse_font_ppem, "Set x,y pixels per EM (default: 0; disabled)", "1/2 integers"}, {"font-ptem", 0, 0, G_OPTION_ARG_DOUBLE, &this->ptem, "Set font point-size (default: 0; disabled)", "point-size"}, + {"font-slant", 0, 0, + G_OPTION_ARG_DOUBLE, &this->slant, "Set synthetic slant (default: 0)", "slant ratio; eg. 0.2"}, {"font-funcs", 0, 0, G_OPTION_ARG_STRING, &this->font_funcs, text, "impl"}, {"ft-load-flags", 0, 0, G_OPTION_ARG_INT, &this->ft_load_flags, "Set FreeType load-flags (default: 2)", "integer"}, {nullptr}