Advertisement
Guest User

hg diff

a guest
Jun 24th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.14 KB | None | 0 0
  1. diff -r dc76e3909d36 libinterp/interp-core/gl-render.cc
  2. --- a/libinterp/interp-core/gl-render.cc Thu Jun 13 11:56:09 2013 -0400
  3. +++ b/libinterp/interp-core/gl-render.cc Mon Jun 24 15:57:55 2013 +0200
  4. @@ -2668,7 +2668,8 @@
  5. text_renderer.set_font (props.get ("fontname").string_value (),
  6. props.get ("fontweight").string_value (),
  7. props.get ("fontangle").string_value (),
  8. - props.get ("fontsize").double_value ());
  9. + props.get ("fontsize").double_value (),
  10. + props.get ("lineheight").double_value ());
  11. #endif
  12. }
  13.  
  14. diff -r dc76e3909d36 libinterp/interp-core/txt-eng-ft.cc
  15. --- a/libinterp/interp-core/txt-eng-ft.cc Thu Jun 13 11:56:09 2013 -0400
  16. +++ b/libinterp/interp-core/txt-eng-ft.cc Mon Jun 24 15:57:55 2013 +0200
  17. @@ -94,9 +94,9 @@
  18. static void cleanup_instance (void) { delete instance; instance = 0; }
  19.  
  20. static FT_Face get_font (const std::string& name, const std::string& weight,
  21. - const std::string& angle, double size)
  22. + const std::string& angle, double size, double lineheight)
  23. { return (instance_ok ()
  24. - ? instance->do_get_font (name, weight, angle, size)
  25. + ? instance->do_get_font (name, weight, angle, size, lineheight)
  26. : 0); }
  27.  
  28. private:
  29. @@ -145,7 +145,7 @@
  30.  
  31.  
  32. FT_Face do_get_font (const std::string& name, const std::string& weight,
  33. - const std::string& angle, double size)
  34. + const std::string& angle, double size, double lineheight)
  35. {
  36. FT_Face retval = 0;
  37.  
  38. @@ -181,6 +181,7 @@
  39. FcPatternAddInteger (pat, FC_WEIGHT, fc_weight);
  40. FcPatternAddInteger (pat, FC_SLANT, fc_angle);
  41. FcPatternAddDouble (pat, FC_PIXEL_SIZE, size);
  42. + FcPatternAddDouble (pat, FC_PIXEL_SIZE, lineheight);
  43.  
  44. if (FcConfigSubstitute (0, pat, FcMatchPattern))
  45. {
  46. @@ -200,9 +201,9 @@
  47. file = reinterpret_cast<char*> (tmp);
  48. }
  49. else
  50. - ::warning ("could not match any font: %s-%s-%s-%g",
  51. + ::warning ("could not match any font: %s-%s-%s-%g-%g",
  52. name.c_str (), weight.c_str (), angle.c_str (),
  53. - size);
  54. + size, lineheight );
  55.  
  56. if (match)
  57. FcPatternDestroy (match);
  58. @@ -241,7 +242,7 @@
  59. : text_processor (), face (0), bbox (1, 4, 0.0),
  60. xoffset (0), yoffset (0), multiline_halign (0),
  61. multiline_align_xoffsets (), mode (MODE_BBOX),
  62. - red (0), green (0), blue (0)
  63. + red (0), green (0), blue (0), lineheight (1)
  64. {
  65. }
  66.  
  67. @@ -253,13 +254,13 @@
  68.  
  69. void
  70. ft_render::set_font (const std::string& name, const std::string& weight,
  71. - const std::string& angle, double size)
  72. + const std::string& angle, double size, double lineheight)
  73. {
  74. if (face)
  75. FT_Done_Face (face);
  76.  
  77. // FIXME: take "fontunits" into account
  78. - face = ft_manager::get_font (name, weight, angle, size);
  79. + face = ft_manager::get_font (name, weight, angle, size, lineheight);
  80.  
  81. if (face)
  82. {
  83. @@ -342,7 +343,7 @@
  84. {
  85. line_index++;
  86. xoffset = multiline_align_xoffsets[line_index];
  87. - yoffset -= (face->size->metrics.height >> 6);
  88. + yoffset -= (lineheight * (face->size->metrics.height >> 6));
  89. }
  90. }
  91. else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL))
  92. @@ -410,7 +411,7 @@
  93. // allocate a bounding box larger than the horizontal
  94. // width of the multi-line
  95. box_line_width = 0;
  96. - bbox(1) -= (face->size->metrics.height >> 6);
  97. + bbox(1) -= (lineheight * (face->size->metrics.height >> 6));
  98. }
  99. }
  100. else
  101. diff -r dc76e3909d36 libinterp/interp-core/txt-eng-ft.h
  102. --- a/libinterp/interp-core/txt-eng-ft.h Thu Jun 13 11:56:09 2013 -0400
  103. +++ b/libinterp/interp-core/txt-eng-ft.h Mon Jun 24 15:57:55 2013 +0200
  104. @@ -71,7 +71,7 @@
  105. Matrix get_extent (const std::string& txt, double rotation = 0.0);
  106.  
  107. void set_font (const std::string& name, const std::string& weight,
  108. - const std::string& angle, double size);
  109. + const std::string& angle, double size, double lineheight);
  110.  
  111. void set_color (Matrix c);
  112.  
  113. @@ -91,6 +91,7 @@
  114. ft_render& operator = (const ft_render&);
  115.  
  116. private:
  117. + double lineheight;
  118. FT_Face face;
  119. Matrix bbox;
  120. uint8NDArray pixels;
  121. @@ -100,6 +101,7 @@
  122. std::vector<int> multiline_align_xoffsets;
  123. int mode;
  124. uint8_t red, green, blue;
  125. +
  126. };
  127.  
  128. #endif // HAVE_FREETYPE
  129. diff -r dc76e3909d36 libinterp/interpfcn/graphics.cc
  130. --- a/libinterp/interpfcn/graphics.cc Thu Jun 13 11:56:09 2013 -0400
  131. +++ b/libinterp/interpfcn/graphics.cc Mon Jun 24 15:57:55 2013 +0200
  132. @@ -5618,7 +5618,8 @@
  133. text_renderer.set_font (get ("fontname").string_value (),
  134. get ("fontweight").string_value (),
  135. get ("fontangle").string_value (),
  136. - get ("fontsize").double_value ());
  137. + get ("fontsize").double_value (),
  138. + 1);
  139. #endif
  140. #endif
  141. }
  142. @@ -7144,7 +7145,8 @@
  143. renderer.set_font (get ("fontname").string_value (),
  144. get ("fontweight").string_value (),
  145. get ("fontangle").string_value (),
  146. - get ("fontsize").double_value ());
  147. + get ("fontsize").double_value (),
  148. + get ("lineheight").double_value ());
  149. #endif
  150. renderer.set_color (get_color_rgb ());
  151. #endif
  152. @@ -7630,7 +7632,8 @@
  153. text_renderer.set_font (get_fontname (),
  154. get_fontweight (),
  155. get_fontangle (),
  156. - get_fontsize ());
  157. + get_fontsize (),
  158. + 1);
  159. #endif
  160. box = text_renderer.get_extent (elt, 0);
  161.  
  162. diff -r dc76e3909d36 libinterp/interpfcn/graphics.in.h
  163. --- a/libinterp/interpfcn/graphics.in.h Thu Jun 13 11:56:09 2013 -0400
  164. +++ b/libinterp/interpfcn/graphics.in.h Mon Jun 24 15:57:55 2013 +0200
  165. @@ -3815,6 +3815,7 @@
  166. radio_property fontangle u , "{normal}|italic|oblique"
  167. string_property fontname u , OCTAVE_DEFAULT_FONTNAME
  168. double_property fontsize u , 10
  169. + double_property lineheight h , 1
  170. radio_property fontunits SU , "{points}|normalized|inches|centimeters|pixels"
  171. radio_property fontweight u , "{normal}|light|demi|bold"
  172. radio_property gridlinestyle , "-|--|{:}|-.|none"
  173. @@ -3963,6 +3964,7 @@
  174. void update_font (void);
  175. void update_fontname (void) { update_font (); }
  176. void update_fontsize (void) { update_font (); }
  177. + void update_lineheight (void) { update_font (); }
  178. void update_fontangle (void) { update_font (); }
  179. void update_fontweight (void) { update_font (); }
  180.  
  181. @@ -4274,6 +4276,7 @@
  182. color_property color u , color_values (0, 0, 0)
  183. string_property fontname u , OCTAVE_DEFAULT_FONTNAME
  184. double_property fontsize u , 10
  185. + double_property lineheight u , 1
  186. radio_property fontangle u , "{normal}|italic|oblique"
  187. radio_property fontweight u , "light|{normal}|demi|bold"
  188. radio_property interpreter u , "{tex}|none|latex"
  189. @@ -4358,6 +4361,7 @@
  190. void update_color (void) { update_font (); }
  191. void update_fontname (void) { update_font (); update_text_extent (); }
  192. void update_fontsize (void) { update_font (); update_text_extent (); }
  193. + void update_lineheight (void) { update_font (); update_text_extent (); }
  194. void update_fontangle (void) { update_font (); update_text_extent (); }
  195. void update_fontweight (void) { update_font (); update_text_extent (); }
  196. void update_interpreter (void) { update_text_extent (); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement