|
From: Allin C. <cot...@wf...> - 2009-11-03 17:39:40
|
On Mon, 2 Nov 2009, Allin Cottrell wrote:
> I have an idea of what might help pngcairo/mingw, but I need to do
> some testing on Windows to make sure I know what I'm taking about.
s/taking/talking. But anyway, I think I have one piece of the
puzzle.
In src/wxterminal/gp_cairo.c, in the function gp_cairo_draw_text,
at lines 749 to 752, we originally had:
vert_just = ((double)ink_rect.height/2 +(double)ink_rect.y) /
PANGO_SCALE;
where "ink_rect" is filled out via pango_layout_get_extents().
I presume this is code that Timothee wrote (?).
In March 2009 Ethan disabled this line and substituted
vert_just = avg_vchar/2;
with the comment 'Adjusting the vertical position for every
character fragment leads to uneven baselines. Better to adjust to
the "average" character height.'
I just did two builds of current CVS gnuplot for win32 -- one "as
is" (A) and one in which I reverted the March 2009 change in
respect of "vert_just" (B) -- and ran the following script on
Vista for each build:
<script>
set term pngcairo font "verdana,8"
set output 'test8.png'
set title 'Qyg0a'
set ylabel 'Qyg0a'
set xrange [0:300.8]
plot x title 'Qyg0a8'
set term pngcairo font "verdana,9"
set output 'test9.png'
plot x title 'Qyg0a9'
</script>
Results:
8-point font: Using build A the title at top has missing pixels
from the bottom of 'Q', 'y' and 'g'; using build B the title is
rendered without missing pixels. The ylabel (rotated) has pixels
missing from the 'Q' in the output from both builds.
9-point font: Using build A both the title and the ylabel have
pixels missing from the bottom of the letters that extend below
(or, for the rotated yabel, to the right of) the baseline. This
is fixed using build B.
I have put the PNG output files (test8a.png, test9a.png from build
A; test8b.png, test9b.png from build B) in
http://www.wfu.edu/~cottrell/gptest/
I find that the differences are seen most easily by opening both
test8a.png and test8b.png (or test9a and test9b) in xv, and
toggling between them.
Allin Cottrell
|