I tried 'Arial' but it just reverted to the system font. From my original post (code below), FontSize works correctly for FaceName 'Lucida Console' or 'Consolas'. In program ConsoleDemo that is included in the console.7z download, there are compiler directives -Īre they actually needed there or are they just redundant from the console.pas unit where they are also included?ģ. Before I set a new FaceName, FontSize in procedure Set_console_fontsize, I want to save the current (original) values so that these can be restored when the program closes. (I haven't yet tried it in my main program.) However, a couple of questions -ġ. However, the last (fully commented) may be more informative. These are identical except that the first has mostly been stripped of comments. Note: below are two separate Set_default_codepage units. I don't want to use unicode as this may cause unforeseen problems (for example, in a wordwrap unit). (The crt unit is not needed for this demo program but would be needed for the actual program.)
Note: the images show that the output codepage and the system codepage are the same in both cases. However if "uses crt" is included then the font characters aren't correct (appear to be from another codepage - see "crt unit used.jpg"). At the same time I want to be able to output hi-order characters (between 127 - 255) from codepage 437 ( ).Ĭorrected - The following works fine if "uses crt" is NOT included ("crt unit not used.jpg" shows the desired result with Greek characters).
#Free pascal crt unit windows
I'm trying to set the font size in a Windows console program.