Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  font difference between 1.1 and 1.4  (Read 2123 times)
0 Members and 1 Guest are viewing this topic.
Offline MGodehardt

Junior Devvie




why does the chicken cross the road?


« Posted 2004-08-17 16:48:12 »

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  Cry

is this a known bug HuhHuh

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

Senior Devvie





« Reply #1 - Posted 2004-08-17 18:34:21 »

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.
Offline MGodehardt

Junior Devvie




why does the chicken cross the road?


« Reply #2 - Posted 2004-08-18 07:17:24 »

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

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  Angry

is there any workaround Huh? 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 Huh

black magic Huh
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mark Thornton

Senior Devvie





« Reply #3 - Posted 2004-08-18 07:54:00 »

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).
Offline MGodehardt

Junior Devvie




why does the chicken cross the road?


« Reply #4 - Posted 2004-08-18 08:28:01 »

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

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #5 - Posted 2004-08-19 09:50:18 »

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

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Pages: [1]
  ignore  |  Print  
 
 

 
DesertCoockie (52 views)
2018-05-13 18:23:11

nelsongames (83 views)
2018-04-24 18:15:36

nelsongames (74 views)
2018-04-24 18:14:32

ivj94 (759 views)
2018-03-24 14:47:39

ivj94 (87 views)
2018-03-24 14:46:31

ivj94 (643 views)
2018-03-24 14:43:53

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!