[Top][All Lists]

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

Re: [XBoard-devel] Fwd: 4.9.0 what's new

From: H.G. Muller
Subject: Re: [XBoard-devel] Fwd: 4.9.0 what's new
Date: Sun, 3 Apr 2016 17:57:13 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Op 4/3/2016 om 5:32 PM schreef Joshua Pettus:
Regarding adjusting for interactive board sizing, I don’t think you need to do anything. It looks like it’s working right now! What is I think was important was that the font loaded correctly at the initial board size. From what I’m seeing, after that you can resize the board to your heart’s content. It’s not going to unload the font for another one. Just as if you set the font in the font dialog box. Then when we resize the board, we don’t suddenly loose that change.
True, but for the clock font it would actually be desirable that it adapts. The main problem, however, is that changing the clock font even without resize breaks the window sizing, so that part of the board will be blank or clipped. This is caused by the method I use for determining square size from window size: I start up XBoard with a 1x1 board, and after pop up of the window read the size of the outer window. That tells me how much height the menu bar + clocks + message/buttons need. And then I assume this will be constant during the session, adding it to the board height to know how much total window size I must request to tightly fit around the board. If the clock font changes, this vertical margin should change, but I don't know by how much.

I guess I could read out the height of the clock widget before and after the font change, to see how much the 'vertical margin' has to change. (And similarly for the message window.)

Once this works adapting the font during resize would not be so difficult. First calculate the new square size assuming no font change. Then look up what fonts belong to it, and change the clock and message font to those. If the clock height decreased by that, you are done. If it increased recalculate how much the square size should be with the increased clock height, look up what font belongs to that (which would normally be smaller, belonging to smaller square size), and use those.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]