octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Google Summer of Code - LaTeX processing


From: Andrej Lojdl
Subject: Re: Google Summer of Code - LaTeX processing
Date: Wed, 19 Jun 2013 14:57:38 +0200

Please, try to produce proper patches using "hg diff". In the above code, I don't see anything that will pass the line_height value down to text engine. By comparison, you should follow how it's done for the fontsize:
1) extend ft_render::set_font() method with a "lineheight" argument
2) populate that new argument in opengl_renderer::set_font() method

Also, don't use "line_height", but "lineheight" for the property name, to be consistent with the rest of the property names. And I think it's better  to make lineheight a scaling factor rather than an absolute offset. In the latter case, it would then be more appropriate to make lineheight sensitive to the "units" property, but I don't want to go down that road.

Michael.

Her is proper patch. I cloned from my repository (I messed something in last one) and add same lines and then hg diff. As I was typing this, I received your email, Michael.
I am working on your suggestions. 

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 Wed Jun 19 14:55:17 2013 +0200
@@ -342,7 +342,7 @@
                       {
                         line_index++;
                         xoffset = multiline_align_xoffsets[line_index];
-                        yoffset -= (face->size->metrics.height >> 6);
+                        yoffset -= (line_height + (face->size->metrics.height >> 6));
                       }
                     }
                   else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL))
@@ -410,7 +410,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) -= (line_height + (face->size->metrics.height >> 6));
                       }
                     }
                   else
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 Wed Jun 19 14:55:17 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 line_height hu, 0
       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_line_height (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 line_height hu , 0
       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_line_height (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 (); }
@@ -4995,6 +4999,7 @@
       radio_property fontangle u , "{normal}|italic|oblique"
       string_property fontname u , OCTAVE_DEFAULT_FONTNAME
       double_property fontsize u , 10
+      double_property line_height hu , 0
       radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
       radio_property fontweight u , "light|{normal}|demi|bold"
       color_property foregroundcolor , color_values (0, 0, 0)
@@ -5084,6 +5089,7 @@
       radio_property fontangle , "{normal}|italic|oblique"
       string_property fontname , OCTAVE_DEFAULT_FONTNAME
       double_property fontsize , 10
+      double_property line_height , 0
       radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels"
       radio_property fontweight , "light|{normal}|demi|bold"
       color_property foregroundcolor , color_values (0, 0, 0)

--
Andrej


reply via email to

[Prev in Thread] Current Thread [Next in Thread]