Menu

#2662 turn report sometimes uses wrong font

Fixed_0.11.4
closed-fixed
nobody
UI (42)
5
2015-08-01
2014-02-11
Lone_Wolf
No

For a long time now i have noticed that sometimes the turn report uses a wrong font, making it ugly.

weird font

normal font
normal font

It appears random, and upon reloading the next turn report is normal again and stays that way for many turns..

It has happened with several freecol and java versions, and i have not found a common cause.
Afaik ONLY the turn report has this problem.
It may very well turn out to be a openjdk/java bug, but perhaps a logging message could be added to find out more about the cause ?

Discussion

  • Mike Pope

    Mike Pope - 2014-02-11

    Confirmed. I have seen this too, but have no idea why or how it happens.

     
  • Mike

    Mike - 2014-02-13

    Seen that too. Happened when closed turn report, and then opened again through "reports" menu on the top.

     
  • Mike Pope

    Mike Pope - 2014-06-08
    • labels: --> UI
     
  • William Astle

    William Astle - 2014-09-28

    This seems to be less frequent in current trunk but I managed to trigger it by fiddling with the menus while while it wasn't my turn. When the turn report appeared while I was in the menus, the font was wrong. I haven't been able to reproduce it though.

     
  • wintertime

    wintertime - 2015-03-09

    I made the FontResource class log warnings if it fails to load a font or the emergency font gets used. That should help catching this bug if it reappears.

     
  • Mike Pope

    Mike Pope - 2015-03-09

    I have not seen this happen for a while. Being optimistic, perhaps some of the earlier synchronization and resource clean up may have accidentally fixed it. Has anyone else had a recent sighting?

     
  • wintertime

    wintertime - 2015-04-11

    I think I found the cause. The Utility.getDefaultTextPane method uses a hacky method for producing the font which does not work as advertised, as the overridden method gets called with a different font name and causes the emergency font to get used.
    I found this while noticing the weird font in the F12 panel and then looking for the cause.

    Maybe the best fix would be making the method look more like the getDefaultTextArea method above it in the file?

     
  • Mike Pope

    Mike Pope - 2015-04-12

    The Utility.getDefaultTextPane method uses a hacky method for producing the font which does not work as advertised

    That certainly looks likely to be the problem. I suggest you cut out that code and replace it with one of your new FontLibrary calls, similar to getDefaultTextArea as you say.

     
  • wintertime

    wintertime - 2015-04-12

    I removed the whole getFont override in git d48568a4, as it looks like the default handling can find the normal font like all other widgets do.
    I'm pretty sure its fixed, but would feel better if it is tested by other people.

     
  • wintertime

    wintertime - 2015-04-28
    • status: open --> pending-fixed
    • Group: Current --> Fixed_trunk
     
  • Mike Pope

    Mike Pope - 2015-08-01
    • Group: Fixed_trunk --> Fixed_0.11.4
     
  • Mike Pope

    Mike Pope - 2015-08-01
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB