change-font(2)change-font - Change the screen font
[X-Windows]
n change-font [ "fontName" ]
[IBM-PC / MS-DOS]
change-font "mode-no" "spec"
[Microsoft Windows]
n change-font [ charSet ]
n change-font [ charSet "fontName" weight width height ]
change-font is a platform specific command which allows the displayable font to be queried and modified. The selection of font is determined by the monitor resolution and the capabilities of the graphics adapter.
This command is available on all systems except termcap. While MS-DOS version does not support the concept of different fonts, it does (or at least the graphics card does) support the concept of changing screen resolution, which has the effect of changing the font. Each platform takes different arguments and are considered independently, as follows:
The X-Windows UNIX environments accept a single argument which is a fully qualified font name. Simply give the font X name and the font will change if it is available. The window size changes to attempt to retain the same number of rows and columns so ensure that when changing to a larger font then there is enough room (or a way) to resize a window which is larger than the actual screen.
The X font string describes the attributes of the font in terms of it's size name etc. as follows:-
-foundry-family-weight-slant-width--pixels-point-hres-vres-space-av-set
Where
foundry
family
weight
slant
width
pixels
point
hres
vres
space
av
set
The default font used by MicroEmacs is the first font that is iso8859, of family fixed (then clean), of point size 14, 13 or 12 of medium or regular weight, i.e. the following are tried in order:
-*-fixed-medium-r-*-*-*-140-*-*-*-*-iso8859-* -*-fixed-regular-r-*-*-*-140-*-*-*-*-iso8859-* -*-fixed-medium-r-*-*-*-130-*-*-*-*-iso8859-* ... -*-fixed-regular-r-*-*-*-120-*-*-*-*-iso8859-* -*-clean-medium-r-*-*-*-140-*-*-*-*-iso8859-* ... -*-clean-regular-r-*-*-*-120-*-*-*-*-iso8859-* -*-fixed-regular-r-*-*-*-120-*-*-*-*-*-* ...
Try running xfontsel(1) in an xterm if struggling to find a suitable font. The font may also be changed in your .Xdefaults file by inserting the line:-
MicroEmacs.font "-misc-fixed-medium-r-normal--13-*-*-*-c-80-iso8859-1"
The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:
0x01
0x02
0x04
"|<flg>|||<pixel-width>|<pixel-height>|||<fontName>|"
The <flg> is an bitwise integer value where bit 1 indicates the font is not fixed width, i.e. the font space is of type proportional.
MS-DOS may only change the screen resolution, the standard screen resolution is either 80 columns by 25 rows or 80 by 50. A more advanced graphics card can typically support up to 132 by 60, MicroEmacs in theory has no limit but it has only been tested up to this size.
The main problem with MS-DOS machines is that there is no standard and this is no exception. The graphics mode needed to get a 132 by 60 screen (if available) varies from one card to the next so MicroEmacs needs to know the graphic mode number your card uses to get your required screen resolution.
MicroEmacs can also attempt a little bit of magic to double the number of rows on the screen for a given screen resolution. This is how 50 lines are obtained from the standard 25 line mode 3. If the value of "spec" is non-zero then this is attempted, to the authors knowledge this will either work or not depending on the direction of the wind and no harm will befall the users equipment. However the author also quickly disclaims anything and everything, the user uses this at their own peril, like everything else.
MicroEmacs attempts to determine the new screen width and depth itself, in case this fails the commands change-frame-width(2) and change-frame-depth(2) may be used to correct the problem.
Following are the standard MS-DOS text modes:
change-font "2" "0" ; Simple monochrome or EGA monitor, 80 by 25. change-font "3" "0" ; Simple EGA/VGA monitor, again 80 by 25. change-font "3" "1" ; Simple EGA/VGA monitor using spec, 80 by 50.
Most Trident cards support the following text mode:
change-font "86" "0" ; Sweet 132 by 60
A Diamond Stealth supports the following mode:
change-font "85" "1" ; Nice 132 by 50
Cirrus video cards (1MB) seem to support:
change-font "84" "1" ; PT-526 (132x50)
Time to start digging out your graphics card manual!
The Microsoft Windows console version does not support the changing of fonts as the Windows Console does not officially support such a feature. However the change-font command can be used to inform MicroEmacs of the type of character set to use for copy text to and from the system clipboard.
The Microsoft Windows environments utilize font files to drive the display. When change-font is invoked, by default a font dialog is presented to the user to allow the font to be selected, the dialog only lists fixed width fonts as proportially based fonts are not supported due to the way in which MicroEmacs renders to the screen.
The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:
0x01
0x02
0x04
"|<flg>|<char-set>|<weight>|<pixel-width>|<pixel-height>|<width>|<height>|<fontName>|"
The <flg> is an bitwise integer value where bit 1 indicates the font is not fixed width, bit 2 indicates it is a vector font and bit 4 that it is a TrueType font. Note that the <width> and <height> values are in logical units and usually differ to the actual size in pixels, see width and height below for more details.
0x08
0x10
The default value when n is not specified is 9.
When entering the font details manually, the following information is required:
charSet
0 - ANSI or Western (True Type etc)
161 - Greek
162 - Turkish
204 - Russian
255 - OEM (or bitmapped)
fontName
An empty name ("") may be specified in which case no further details are requested and the default font is used for the given character set.
Note that, depending on the version of Windows, Courier New may not actually be a fixed mono font as might be expected.
weight
0 - Don't care (Automatically selected).
1 - Thin
2 - Extra Light
3 - Light
4 - Normal
5 - Medium
6 - Semi-Bold
7 - Bold
8 - Extra-Bold
9 - Heavy
Note that you may request a weight and it is not honored. Typically 4 and 7 are honored by most font definitions. 4 is typically used.
width
Note that if the width is specified as zero then the height should be specified and the width will be automatically selected.
height
Note: as with the weight the width and height may not be honored if the font cannot support the specified width/height in which case the closest matching height is automatically selected
For releases prior to '99, the Terminal font is the standard MS-DOS font used for the MS-DOS window. This is an OEM fixed width character set which contains all of the conventional symbols found in the DOS shell.
Releases of MicroEmacs post '99 may utilise any of the windows fonts, typically Courier New or Lucida Console are used, these provide the best screen rendering of characters. Lucida Console is slightly better with a smaller font size as this allows a '1' (one) and 'l' (lower case L) to be distinguished.
The Terminal fonts are the same as shown in the DOS window the last 2 arguments are the width x height, the terminal equivalents (Bit Mapped) are commented here.
7x12
6x8
The best options for the fonts are defined as follows:-
;Standard Terminal Fonts - standard weight ;change-font 0 "Terminal" 4 4 6 change-font 0 "Terminal" 4 6 8 ;change-font 0 "Terminal" 4 8 8 ;change-font 0 "Terminal" 4 5 12 ;change-font 0 "Terminal" 4 7 12 ;change-font 0 "Terminal" 4 8 12 ;change-font 0 "Terminal" 4 12 16 ;change-font 0 "Terminal" 4 10 18 ;Standard Terminal Fonts - heavy weight ;change-font 0 "Terminal" 7 4 6 ;change-font 0 "Terminal" 7 6 8 ;change-font 0 "Terminal" 7 8 8 ;change-font 0 "Terminal" 7 5 12 ;change-font 0 "Terminal" 7 7 12 ;change-font 0 "Terminal" 7 8 12 ;change-font 0 "Terminal" 7 12 16 ;change-font 0 "Terminal" 7 10 18
The "Courier New" font is not actually a fixed mono font as might be expected.
(c) Copyright JASSPA 2025
Last Modified: 2024/08/27
Generated On: 2025/09/29