font difference between 1.1 and 1.4

under 1.1.4 font sansserif size=12 has height 15 and under 1.4.2 it has height 16

thank you for being backwards compatible :’(

is this a known bug ???

sanserif is mapped to Arial on both font.properties ( i checked it )

I think that in 1.1 font rendering was done by the platform code which meant that such properties were likely to vary from say Windows to Solaris. In 1.2, a font renderer was added to Java, so now you should get identical results on Windows and Solaris (asuming an identical font), but clearly the result may not be identical to the 1.1 case.

but on windows 98 i should get for the same font the same height ???

otherwise java useless, run program with 1.1 on same pc u get 15 pixels run it with 1.4 u get 16 pixel

do u understand what BIG problems this can be, the hole layout does no longer fit, after 20 lines of text i have 20 pixel less than under 1.1 >:(

is there any workaround ??? trick or whatever to fix this without modifiying all my classes

i use sanserif which is mapped to arial under win98, different results between 1.1 and 1.4 15 and 16 pixels

second i use arial which is mapped to arial under win98 BUT NOW I GET 15 pixel for both 1.1 and 1.4

so 1 != 1 wtf ? or maybe 1 + 1 = 3 ???

black magic ???

sanserif is a composite font which is only partly supplied by arial. Some of the characters in sanserif come from other fonts. I think this is the reason why you get different results for sanserif and arial under 1.4. The greater height returned for sanserif is to allow for the heights of those extra characters.

Java does not encourage the use of absolute layouts – you should use layouts which adapt to the actual dimensions of the fonts in use. That way you won’t be caught out when the default font changes from Arial to Tahoma (or whatever).

ok seems the NEED_CONVERTED is causing this, i dont like variable fonts, so seems java fonts are not usable for me, thanks

you could load the correct Font from a file that contains all the info you need :slight_smile: That way you don’t have to make Java guess what it needs to use