On Tuesday, 19 July 2016 10:52 PM, Sebastian Lackner wrote:
It looks like your code requests the font size from the wineserver (GetConsoleFontSize) just to send it back immediately afterwards. Is that intentional?And wouldn't it make more sense to implement support for multiple font sizes first?
SetConsoleFont uses the index to look up the relevant font size from the system font table, which is undocumented. Calling GetConsoleFontSize is intentional, although we could look up the font table ourselves, I suppose.
We decided a while back to only have one font in our font table. I guess that makes SetConsoleFont redundant for the moment. If we were to implement support for multiple file sizes, I'm not sure where that support would reside. Kernel32 is too low-level, as enumerating fonts uses GDI32. Any ideas?
Also note that the Windows font table includes the console raster font and the fonts listed in LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont.
We list nothing in that registry key, and wineconsole supports all fonts that meet the fixed width criteria, making this a huge task.
Also, please note that the GetNumberOfConsoleFonts() check is unnecessary because GetConsoleFontSize() already takes care of that.
True, good point.
Thanks for the review.