Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r dc76e3909d36 libinterp/interp-core/gl-render.cc
- --- a/libinterp/interp-core/gl-render.cc Thu Jun 13 11:56:09 2013 -0400
- +++ b/libinterp/interp-core/gl-render.cc Mon Jun 24 15:57:55 2013 +0200
- @@ -2668,7 +2668,8 @@
- text_renderer.set_font (props.get ("fontname").string_value (),
- props.get ("fontweight").string_value (),
- props.get ("fontangle").string_value (),
- - props.get ("fontsize").double_value ());
- + props.get ("fontsize").double_value (),
- + props.get ("lineheight").double_value ());
- #endif
- }
- diff -r dc76e3909d36 libinterp/interp-core/txt-eng-ft.cc
- --- a/libinterp/interp-core/txt-eng-ft.cc Thu Jun 13 11:56:09 2013 -0400
- +++ b/libinterp/interp-core/txt-eng-ft.cc Mon Jun 24 15:57:55 2013 +0200
- @@ -94,9 +94,9 @@
- static void cleanup_instance (void) { delete instance; instance = 0; }
- static FT_Face get_font (const std::string& name, const std::string& weight,
- - const std::string& angle, double size)
- + const std::string& angle, double size, double lineheight)
- { return (instance_ok ()
- - ? instance->do_get_font (name, weight, angle, size)
- + ? instance->do_get_font (name, weight, angle, size, lineheight)
- : 0); }
- private:
- @@ -145,7 +145,7 @@
- FT_Face do_get_font (const std::string& name, const std::string& weight,
- - const std::string& angle, double size)
- + const std::string& angle, double size, double lineheight)
- {
- FT_Face retval = 0;
- @@ -181,6 +181,7 @@
- FcPatternAddInteger (pat, FC_WEIGHT, fc_weight);
- FcPatternAddInteger (pat, FC_SLANT, fc_angle);
- FcPatternAddDouble (pat, FC_PIXEL_SIZE, size);
- + FcPatternAddDouble (pat, FC_PIXEL_SIZE, lineheight);
- if (FcConfigSubstitute (0, pat, FcMatchPattern))
- {
- @@ -200,9 +201,9 @@
- file = reinterpret_cast<char*> (tmp);
- }
- else
- - ::warning ("could not match any font: %s-%s-%s-%g",
- + ::warning ("could not match any font: %s-%s-%s-%g-%g",
- name.c_str (), weight.c_str (), angle.c_str (),
- - size);
- + size, lineheight );
- if (match)
- FcPatternDestroy (match);
- @@ -241,7 +242,7 @@
- : text_processor (), face (0), bbox (1, 4, 0.0),
- xoffset (0), yoffset (0), multiline_halign (0),
- multiline_align_xoffsets (), mode (MODE_BBOX),
- - red (0), green (0), blue (0)
- + red (0), green (0), blue (0), lineheight (1)
- {
- }
- @@ -253,13 +254,13 @@
- void
- ft_render::set_font (const std::string& name, const std::string& weight,
- - const std::string& angle, double size)
- + const std::string& angle, double size, double lineheight)
- {
- if (face)
- FT_Done_Face (face);
- // FIXME: take "fontunits" into account
- - face = ft_manager::get_font (name, weight, angle, size);
- + face = ft_manager::get_font (name, weight, angle, size, lineheight);
- if (face)
- {
- @@ -342,7 +343,7 @@
- {
- line_index++;
- xoffset = multiline_align_xoffsets[line_index];
- - yoffset -= (face->size->metrics.height >> 6);
- + yoffset -= (lineheight * (face->size->metrics.height >> 6));
- }
- }
- else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL))
- @@ -410,7 +411,7 @@
- // allocate a bounding box larger than the horizontal
- // width of the multi-line
- box_line_width = 0;
- - bbox(1) -= (face->size->metrics.height >> 6);
- + bbox(1) -= (lineheight * (face->size->metrics.height >> 6));
- }
- }
- else
- diff -r dc76e3909d36 libinterp/interp-core/txt-eng-ft.h
- --- a/libinterp/interp-core/txt-eng-ft.h Thu Jun 13 11:56:09 2013 -0400
- +++ b/libinterp/interp-core/txt-eng-ft.h Mon Jun 24 15:57:55 2013 +0200
- @@ -71,7 +71,7 @@
- Matrix get_extent (const std::string& txt, double rotation = 0.0);
- void set_font (const std::string& name, const std::string& weight,
- - const std::string& angle, double size);
- + const std::string& angle, double size, double lineheight);
- void set_color (Matrix c);
- @@ -91,6 +91,7 @@
- ft_render& operator = (const ft_render&);
- private:
- + double lineheight;
- FT_Face face;
- Matrix bbox;
- uint8NDArray pixels;
- @@ -100,6 +101,7 @@
- std::vector<int> multiline_align_xoffsets;
- int mode;
- uint8_t red, green, blue;
- +
- };
- #endif // HAVE_FREETYPE
- diff -r dc76e3909d36 libinterp/interpfcn/graphics.cc
- --- a/libinterp/interpfcn/graphics.cc Thu Jun 13 11:56:09 2013 -0400
- +++ b/libinterp/interpfcn/graphics.cc Mon Jun 24 15:57:55 2013 +0200
- @@ -5618,7 +5618,8 @@
- text_renderer.set_font (get ("fontname").string_value (),
- get ("fontweight").string_value (),
- get ("fontangle").string_value (),
- - get ("fontsize").double_value ());
- + get ("fontsize").double_value (),
- + 1);
- #endif
- #endif
- }
- @@ -7144,7 +7145,8 @@
- renderer.set_font (get ("fontname").string_value (),
- get ("fontweight").string_value (),
- get ("fontangle").string_value (),
- - get ("fontsize").double_value ());
- + get ("fontsize").double_value (),
- + get ("lineheight").double_value ());
- #endif
- renderer.set_color (get_color_rgb ());
- #endif
- @@ -7630,7 +7632,8 @@
- text_renderer.set_font (get_fontname (),
- get_fontweight (),
- get_fontangle (),
- - get_fontsize ());
- + get_fontsize (),
- + 1);
- #endif
- box = text_renderer.get_extent (elt, 0);
- diff -r dc76e3909d36 libinterp/interpfcn/graphics.in.h
- --- a/libinterp/interpfcn/graphics.in.h Thu Jun 13 11:56:09 2013 -0400
- +++ b/libinterp/interpfcn/graphics.in.h Mon Jun 24 15:57:55 2013 +0200
- @@ -3815,6 +3815,7 @@
- radio_property fontangle u , "{normal}|italic|oblique"
- string_property fontname u , OCTAVE_DEFAULT_FONTNAME
- double_property fontsize u , 10
- + double_property lineheight h , 1
- radio_property fontunits SU , "{points}|normalized|inches|centimeters|pixels"
- radio_property fontweight u , "{normal}|light|demi|bold"
- radio_property gridlinestyle , "-|--|{:}|-.|none"
- @@ -3963,6 +3964,7 @@
- void update_font (void);
- void update_fontname (void) { update_font (); }
- void update_fontsize (void) { update_font (); }
- + void update_lineheight (void) { update_font (); }
- void update_fontangle (void) { update_font (); }
- void update_fontweight (void) { update_font (); }
- @@ -4274,6 +4276,7 @@
- color_property color u , color_values (0, 0, 0)
- string_property fontname u , OCTAVE_DEFAULT_FONTNAME
- double_property fontsize u , 10
- + double_property lineheight u , 1
- radio_property fontangle u , "{normal}|italic|oblique"
- radio_property fontweight u , "light|{normal}|demi|bold"
- radio_property interpreter u , "{tex}|none|latex"
- @@ -4358,6 +4361,7 @@
- void update_color (void) { update_font (); }
- void update_fontname (void) { update_font (); update_text_extent (); }
- void update_fontsize (void) { update_font (); update_text_extent (); }
- + void update_lineheight (void) { update_font (); update_text_extent (); }
- void update_fontangle (void) { update_font (); update_text_extent (); }
- void update_fontweight (void) { update_font (); update_text_extent (); }
- void update_interpreter (void) { update_text_extent (); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement