{
    "content": [
        {
            "type": "text",
            "text": "# SETFONT (man)\n\n## NAME\n\nsetfont - load EGA/VGA console screen font\n\n## SYNOPSIS\n\nsetfont  [-O  font+umap.orig]  [-o  font.orig] [-om cmap.orig] [-ou umap.orig] [-N] [font.new\n...] [-m cmap] [-u umap] [-C console] [-hH] [-v] [-V]\n\n## DESCRIPTION\n\nThe setfont command reads a font from the file font.new and loads it into the EGA/VGA charac‐\nter  generator,  and  optionally outputs the previous font.  It can also load various mapping\ntables and output the previous versions.\n\n## TLDR\n\n> Set the terminal font for TTYs.\n\n- Change the terminal font:\n  `setfont {{font}}.gz`\n- Change the terminal font by specifying a path:\n  `setfont /usr/share/kbd/{{mapping}}/{{font.ext}}`\n- Double font size:\n  `setfont {{-d|--double}}`\n- Reset to the default font:\n  `setfont`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (4 subsections)\n- **FONT FORMATS**\n- **FONT HEIGHT**\n- **CONSOLE MAPS**\n- **UNICODE FONT MAPS**\n- **OPTIONS** (11 subsections)\n- **NOTE**\n- **FILES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "SETFONT",
        "section": "",
        "mode": "man",
        "summary": "setfont - load EGA/VGA console screen font",
        "synopsis": "setfont  [-O  font+umap.orig]  [-o  font.orig] [-om cmap.orig] [-ou umap.orig] [-N] [font.new\n...] [-m cmap] [-u umap] [-C console] [-hH] [-v] [-V]",
        "tldr_summary": "Set the terminal font for TTYs.",
        "tldr_examples": [
            {
                "description": "Change the terminal font",
                "command": "setfont {{font}}.gz"
            },
            {
                "description": "Change the terminal font by specifying a path",
                "command": "setfont /usr/share/kbd/{{mapping}}/{{font.ext}}"
            },
            {
                "description": "Double font size",
                "command": "setfont {{-d|--double}}"
            },
            {
                "description": "Reset to the default font",
                "command": "setfont"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "tally. This is suitable for high pixel density (e.g. \"4k\") displays on which the standard fonts are too small to be easily legible. Due to kernel limitations, this is suitable only for 16x16 or smaller fonts."
            },
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "Load console map or Unicode console map from file."
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": "Save previous font in file."
            },
            {
                "flag": "-O",
                "long": null,
                "arg": null,
                "description": "Save previous font and Unicode map in file."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Store console map in file."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Save previous Unicode map in file."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "Load Unicode table describing the font from file."
            },
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": "Set the font for the indicated console. (May require root permissions.)"
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "psfaddtable",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/psfaddtable/1/json"
            },
            {
                "name": "unicodestart",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/unicodestart/1/json"
            },
            {
                "name": "loadunimap",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/loadunimap/8/json"
            },
            {
                "name": "utf-8",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/utf-8/7/json"
            },
            {
                "name": "mapscrn",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mapscrn/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": [
                    {
                        "name": "setfont",
                        "lines": 2
                    },
                    {
                        "name": "setfont drdos8x16",
                        "lines": 2
                    },
                    {
                        "name": "setfont cybercafe -u cybercafe",
                        "lines": 2
                    },
                    {
                        "name": "setfont LatArCyrHeb-19 -m 8859-2",
                        "lines": 7
                    }
                ]
            },
            {
                "name": "FONT FORMATS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "FONT HEIGHT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "CONSOLE MAPS",
                "lines": 26,
                "subsections": []
            },
            {
                "name": "UNICODE FONT MAPS",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-h",
                        "lines": 1,
                        "flag": "-h"
                    },
                    {
                        "name": "-d",
                        "lines": 4,
                        "flag": "-d"
                    },
                    {
                        "name": "-m",
                        "lines": 2,
                        "flag": "-m"
                    },
                    {
                        "name": "-o",
                        "lines": 2,
                        "flag": "-o"
                    },
                    {
                        "name": "-O",
                        "lines": 2,
                        "flag": "-O"
                    },
                    {
                        "name": "-om",
                        "lines": 2
                    },
                    {
                        "name": "-ou",
                        "lines": 2
                    },
                    {
                        "name": "-u",
                        "lines": 2,
                        "flag": "-u"
                    },
                    {
                        "name": "-C",
                        "lines": 2,
                        "flag": "-C"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    }
                ]
            },
            {
                "name": "NOTE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "setfont - load EGA/VGA console screen font\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "setfont  [-O  font+umap.orig]  [-o  font.orig] [-om cmap.orig] [-ou umap.orig] [-N] [font.new\n...] [-m cmap] [-u umap] [-C console] [-hH] [-v] [-V]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The setfont command reads a font from the file font.new and loads it into the EGA/VGA charac‐\nter  generator,  and  optionally outputs the previous font.  It can also load various mapping\ntables and output the previous versions.\n\nIf no args are given (or only the option -N for some number N), then a default (8xN) font  is\nloaded  (see  below).   One may give several small fonts, all containing a Unicode table, and\nsetfont will combine them and load the union.  Typical use:\n",
                "subsections": [
                    {
                        "name": "setfont",
                        "content": "Load a default font.\n"
                    },
                    {
                        "name": "setfont drdos8x16",
                        "content": "Load a given font (here the 448-glyph drdos font).\n"
                    },
                    {
                        "name": "setfont cybercafe -u cybercafe",
                        "content": "Load a given font that does not have a Unicode map and provide one explicitly.\n"
                    },
                    {
                        "name": "setfont LatArCyrHeb-19 -m 8859-2",
                        "content": "Load a given font (here a 512-glyph font combining several character sets)  and  indi‐\ncate that one's local character set is ISO 8859-2.\n\nNote: if a font has more than 256 glyphs, only 8 out of 16 colors can be used simultaneously.\nIt can make console perception worse (loss of intensity and even some colors).\n\n"
                    }
                ]
            },
            "FONT FORMATS": {
                "content": "The standard Linux font format is the PSF font.  It has a header describing  font  properties\nlike  character size, followed by the glyph bitmaps, optionally followed by a Unicode mapping\ntable giving the Unicode value for each glyph.  Several other  (obsolete)  font  formats  are\nrecognized.   If  the  input file has code page format (probably with suffix .cp), containing\nthree fonts with sizes e.g. 8x8, 8x14 and 8x16, then one of the options -8 or -14 or -16 must\nbe  used  to select one.  Raw font files are binary files of size 256*N bytes, containing bit\nimages for each of 256 characters, one byte per scan line, and N bytes per character (0  <  N\n<= 32).  Most fonts have a width of 8 bits, but with the framebuffer device (fb) other widths\ncan be used.\n\n",
                "subsections": []
            },
            "FONT HEIGHT": {
                "content": "The program setfont has no built-in knowledge of VGA video modes, but just asks the kernel to\nload the character ROM of the video card with certain bitmaps. However, since Linux 1.3.1 the\nkernel knows enough about EGA/VGA video modes to select a different line  distance.  The  de‐\nfault  character  height  will be the number N inferred from the font or specified by option.\nHowever, the user can specify a different character height H using the -h option.\n\n",
                "subsections": []
            },
            "CONSOLE MAPS": {
                "content": "Several mappings are involved in the path from user program output to console display. If the\nconsole is in utf8 mode (see unicodestart(1)) then the kernel expects that user program out‐\nput is coded as UTF-8 (see utf-8(7)), and converts that  to  Unicode  (ucs2).   Otherwise,  a\ntranslation  table  is  used  from  the 8-bit program output to 16-bit Unicode values. Such a\ntranslation table is called a Unicode console map.  There are four of them: three built  into\nthe  kernel,  the fourth settable using the -m option of setfont.  An escape sequence chooses\nbetween these four tables; after loading a cmap, setfont will output the escape sequence  Esc\n( K that makes it the active translation.\n\nSuitable  arguments  for  the  -m option are for example 8859-1, 8859-2, ..., 8859-15, cp437,\n..., cp1250.\n\nGiven the Unicode value of the symbol to be displayed, the kernel finds the  right  glyph  in\nthe font using the Unicode mapping info of the font and displays it.\n\nOld  fonts do not have Unicode mapping info, and in order to handle them there are direct-to-\nfont maps (also loaded using -m) that give a correspondence between user bytes and font posi‐\ntions.   The most common correspondence is the one given in the file trivial (where user byte\nvalues are used directly as font positions).  Other correspondences are sometimes  preferable\nsince the PC video hardware expects line drawing characters in certain font positions.\n\nGiving a -m none argument inhibits the loading and activation of a mapping table.  The previ‐\nous console map can be saved to a file using the -om file option.  These options  of  setfont\nrender mapscrn(8) obsolete. (However, it may be useful to read that man page.)\n\n",
                "subsections": []
            },
            "UNICODE FONT MAPS": {
                "content": "The  correspondence  between the glyphs in the font and Unicode values is described by a Uni‐\ncode mapping table.  Many fonts have a Unicode mapping table included in the font  file,  and\nan  explicit table can be indicated using the -u option. The program setfont will load such a\nUnicode mapping table, unless a -u none argument is given. The previous Unicode mapping table\nwill be saved as part of the saved font file when the -O option is used. It can be saved to a\nseparate file using the -ou file option.  These options of setfont render loadunimap(8) obso‐\nlete.\n\nThe  Unicode  mapping table should assign some glyph to the `missing character' value U+fffd,\notherwise missing characters are not translated, giving a usually very confusing result.\n\nUsually no mapping table is needed, and a Unicode mapping table is already contained  in  the\nfont  (sometimes this is indicated by the .psfu extension), so that most users need not worry\nabout the precise meaning and functioning of these mapping tables.\n\nOne may add a Unicode mapping table to a psf font using psfaddtable(1).\n\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "-h",
                        "content": "",
                        "flag": "-h"
                    },
                    {
                        "name": "-d",
                        "content": "tally.   This  is  suitable  for  high pixel density (e.g. \"4k\") displays on which the\nstandard fonts are too small to be easily legible.  Due to kernel limitations, this is\nsuitable only for 16x16 or smaller fonts.\n",
                        "flag": "-d"
                    },
                    {
                        "name": "-m",
                        "content": "Load console map or Unicode console map from file.\n",
                        "flag": "-m"
                    },
                    {
                        "name": "-o",
                        "content": "Save previous font in file.\n",
                        "flag": "-o"
                    },
                    {
                        "name": "-O",
                        "content": "Save previous font and Unicode map in file.\n",
                        "flag": "-O"
                    },
                    {
                        "name": "-om",
                        "content": "Store console map in file.\n"
                    },
                    {
                        "name": "-ou",
                        "content": "Save previous Unicode map in file.\n"
                    },
                    {
                        "name": "-u",
                        "content": "Load Unicode table describing the font from file.\n",
                        "flag": "-u"
                    },
                    {
                        "name": "-C",
                        "content": "Set the font for the indicated console. (May require root permissions.)\n",
                        "flag": "-C"
                    },
                    {
                        "name": "-v",
                        "content": "",
                        "flag": "-v"
                    },
                    {
                        "name": "-V",
                        "content": "",
                        "flag": "-V"
                    }
                ]
            },
            "NOTE": {
                "content": "PC  video hardware allows one to use the \"intensity\" bit either to indicate brightness, or to\naddress 512 (instead of 256) glyphs in the font. So, if the font has more  than  256  glyphs,\nthe console will be reduced to 8 (instead of 16) colors.\n\n",
                "subsections": []
            },
            "FILES": {
                "content": "/usr/share/consolefonts\nThe default font directory.\n\n/usr/share/unimaps\nThe default directory for Unicode maps.\n\n/usr/share/consoletrans\nThe default directory for screen mappings.\n\nThe  default font is a file default (or default8xN if the -N option was given for some number\nN) perhaps with suitable extension (like .psf).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "psfaddtable(1), unicodestart(1), loadunimap(8), utf-8(7), mapscrn(8)\n\n\n\nkbd                                          11 Feb 2001                                  SETFONT(8)",
                "subsections": []
            }
        }
    }
}