Font ascents bug



Hi,

I'm afraid that I have found a bug in the usage of GtkFont->ascent. The
problem is that the height of a font is ascent + descent + 1 and not
just ascent + descent, as it is used in app places of Gtk that I have
checked. 
If I understands it right, the ascent is pixels high over the main-line
of the font and descent is pixels deep below the main-line. So that
give the extra + 1 for the main-line.

You kan see the bug in action by typing an 'Å' (uppercase aring) and a
'g' in testgtk:s entry-box. You will see that the g is displayed as it
should, but the 'Å' has lost one pixel at the top.

To fix the problem the requsition->height has to be increased and the
calculation of the main-line (the y-croodinate to gdk_draw_text) has
to be increased by one.

At the end of the mail you will find a patch for gtkentry.c to fix the
problem, but it is just to show what I mean.

/Mattias

begin 644 gtkentry.patch
M+2TM(&=T:V5N=')Y+F,)5&AU($%U9R`R,"`R,SHT.3HS,2`Q.3DX"BLK*R!G
M=&ME;G1R>2YC+F9I>&5D"51H=2!!=6<@,C`@,C,Z-#<Z-#D@,3DY.`I`0"`M
M-S,T+#<@*S<S-"PW($!`"B`@(')E<75I<VET:6]N+3YW:61T:"`]($U)3E]%
M3E1265]724142"`K("AW:61G970M/G-T>6QE+3YK;&%S<RT^>'1H:6-K;F5S
M<R`K($E.3D527T)/4D1%4BD@*B`R.PH@("!R97%U:7-I=&EO;BT^:&5I9VAT
M(#T@*'=I9&=E="T^<W1Y;&4M/F9O;G0M/F%S8V5N="`K"B`)"0D@=VED9V5T
M+3YS='EL92T^9F]N="T^9&5S8V5N="`K"BT)"0D@*'=I9&=E="T^<W1Y;&4M
M/FML87-S+3YY=&AI8VMN97-S("L@24Y.15)?0D]21$52*2`J(#(I.PHK"0D)
M("AW:61G970M/G-T>6QE+3YK;&%S<RT^>71H:6-K;F5S<R`K($E.3D527T)/
M4D1%4BD@*B`R*2`K(#$["B!]"B`*('-T871I8R!V;VED"D!`("TQ,S`U+#<@
M*S$S,#4L-R!`0`H@"7T*("`*("`@("`@('D@/2`H:&5I9VAT("T@*'=I9&=E
M="T^<W1Y;&4M/F9O;G0M/F%S8V5N="`K('=I9&=E="T^<W1Y;&4M/F9O;G0M
M/F1E<V-E;G0I*2`O(#(["BT@("`@("!Y("L]('=I9&=E="T^<W1Y;&4M/F9O
M;G0M/F%S8V5N=#L**R`@("`@('D@*ST@=VED9V5T+3YS='EL92T^9F]N="T^
M87-C96YT("L@,3L*(`H@("`@("`@<W1A<G1?8VAA<B`](&=T:U]E;G1R>5]F
M:6YD7W!O<VET:6]N("AE;G1R>2P@96YT<GDM/G-C<F]L;%]O9F9S970I.PH@
M("`@("`@<W1A<G1?<&]S(#T@96YT<GDM/F-H87)?<&]S6W-T87)T7V-H87)=
".PH`
`
end



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