[PATCH] kernel32: Implement SetConsoleFont

Sebastian Lackner sebastian at fds-team.de
Tue Jul 19 09:04:54 CDT 2016


On 19.07.2016 15:50, Hugh McMaster wrote:
> 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.
> 

This method might work in the future (when GetConsoleFontSize is properly implemented), but
as long as there is only one entry, its basically just a complicated looking stub. ;)
Later, when SetConsoleFont() allows changing the font, it will probably also be necessary to
queue a notification event such that wineconsole can update accordingly.

> 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.

Not sure if its feasible, but you could probably implement the enumeration in wineconsole.
The table could then (for example) be stored in a temporary registry key (similar to how font
caching in gdi32 works).

> 
>> Also, please note that the GetNumberOfConsoleFonts() check is unnecessary because
>> GetConsoleFontSize() already takes care of that.
> 
> True, good point.
> 
> Thanks for the review.
> 




More information about the wine-devel mailing list