When specifiying the layout of the children of a TLayoutWindow, the user can use measurement units relative to the current window font (see TMeasurementUnits). The units are converted to pixels based on the font height, which is determined by TLayoutWindow::GetFontHeight by calling WM_GETFONT.
However, TLayoutWindow does not provide an implementation of WM_GETFONT and WM_SETFONT. So an attempt to set the associated window font by sending WM_SETFONT (e.g. by calling TWindow::SetWindowFont) has no effect, and WM_GETFONT (TWindow::GetWindowFont) will always return NULL, leading TLayoutWindow to use the outdated SYSTEM_FONT instead. For a deeper dive into WM_GETFONT and WM_SETFONT, see the blog post "When I send a WM_GETFONT message to a window, why don't I get a font?" at The Old New Thing.
Although WM_GETFONT and WM_SETFONT can be implemented by subclassing TLayoutWindow, it would be helpful if these messages were implemented in the base, as to provide complete support for font-relative units. Since the documentation alludes to such support, and does nothing to explain the need to implement WM_GETFONT and WM_SETFONT, I have classified this issue as a bug, rather than a feature request.
Bugs: #630
Discussion: TWindow::Create fails for TTooltip after port to OWLNext 7
Discussion: TLayoutWindow ignores font setting
Wiki: Frequently_Asked_Questions
This issue was fixed in [r3294] and merged into Owlet in [r3295].
Related
Commit: [r3294]
Commit: [r3295]
Last edit: Vidar Hasfjord 2015-10-21
Diff: