Icons and GUI
This week was all about UI. I implement a nice chunk of a menu system. I can specify if an entry is an action, a submenu, or a separator and draw it all. There isn't any input yet (like mouse move and click) so I'd say the menu code is only half done. Next, I copied my experimental UI code and read each line. It's a start but far from usable. It only works when there's enough space to show all the UI elements. It doesn't try to put content into another line when a line is full.
A problem I didn't expect was spacing around icons. Two things a font has is an x-bearing and x-advance. Imagine "w." is written in a monospace font. It wouldn't look right if the period started rendering where the left of the w started. The x-bearing is how far in the x-axis before the character should be drawn, and the x-advance is how wide the character is (kerning may change this.) The x-advance lets w and . be the same width in monospaced fonts. What I saw was icons having random x-bearing and x-advance making it look very strange if I drew each icon next to each other. The icon for minimize was centered so if I drew it next to the maximize icon it'd look very wrong. Some icons will look wrong if they aren't centered, like the 'x' used to close a panel, so I couldn't outright ignore the y-bearing. What I ended up doing was ignore the x-advance, x-bearing and customized a few y-bearing to have icons look right.
That's everything for this week