Difference between revisions of "Directives/font"

From Syslinux Wiki
Jump to: navigation, search
(Basic details and external links.)
 
m (Minor wiki formatting. Add links.)
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
 
<code>'''FONT''' ''filename''</code><br />
 
<code>'''FONT''' ''filename''</code><br />
  
"FONT" is a global directive that allows showing a set of glyphs (aka characters) different than the BIOS' default.  
+
"FONT" is a global directive that allows showing a set of glyphs  
Typically, the reason to use a font different than the BIOS' default is to be able to display (in the boot screen/menu) characters not included in the default set (i.e. different language).  
+
(aka characters) different than the BIOS' default.  
For example, for Nordic glyphs, the font would need to be based on the "DOS code page 865" (CP865); for Cyrillic &rarr; CP855, and so on.
+
Typically, the reason to use a font different than the BIOS' default is to  
For a basic explanation of the FONT directive see [[Config#FONT]].
+
be able to display (in the boot screen/menu) characters not included in the  
 +
default set (i.e. different language).  
 +
For example, for Nordic glyphs, the font would need to be based on the "DOS  
 +
code page 865" (CP865); for Cyrillic &rarr; CP855, and so on.
 +
For basic usage of the FONT directive see [[Config#FONT]].
  
The type/format of font file recognized by Syslinux is "PC Screen Font"; specifically "PSF1".  
+
The type/format of font file recognized by Syslinux is "PC Screen Font";  
 +
specifically "PSF1".  
 
Optionally, the font file can include a Unicode table too.  
 
Optionally, the font file can include a Unicode table too.  
 
In such case, the file name extension is frequently (but not always) ".psfu".  
 
In such case, the file name extension is frequently (but not always) ".psfu".  
 
The Unicode table is ignored by Syslinux.  
 
The Unicode table is ignored by Syslinux.  
  
Note: It is recommended to use DOS-compatible (aka "8.3") file names with Syslinux.
+
Note: It is recommended to use {{nowrap|DOS-compatible}}
 +
{{nowrap|(aka "8.3")}} file names with Syslinux.
  
 
For the typical BIOS, the psf1 fonts should have the following properties:
 
For the typical BIOS, the psf1 fonts should have the following properties:
Line 31: Line 37:
 
The typical (default) boot screen results in:
 
The typical (default) boot screen results in:
 
  width:          (  8 pixels ) x ( 80 columns ) = 640  
 
  width:          (  8 pixels ) x ( 80 columns ) = 640  
  heigh:
+
  height:
 
       text mode: ( 16 pixels ) x ( 25 rows    ) = 400  
 
       text mode: ( 16 pixels ) x ( 25 rows    ) = 400  
 
   graphics mode: ( 16 pixels ) x ( 30 rows    ) = 480  
 
   graphics mode: ( 16 pixels ) x ( 30 rows    ) = 480  
Line 38: Line 44:
 
You can also search for font files in your  
 
You can also search for font files in your  
 
{{nowrap|"<tt>/usr/share/consolefonts/</tt>"}} or  
 
{{nowrap|"<tt>/usr/share/consolefonts/</tt>"}} or  
{{nowrap|"<tt>/usr/share/kbd/consolefonts/</tt>"}} (or similar) path(s) in your OS.  
+
{{nowrap|"<tt>/usr/share/kbd/consolefonts/</tt>"}} (or similar) path(s) in  
Additional font files can be downloaded, and font editors and converters are also available for various OSes (including DOS).
+
your OS.  
 +
Additional font files can be downloaded, and font editors and converters are  
 +
also available for various OSes (including DOS).
  
  
 
General info:
 
General info:
* https://en.wikipedia.org/wiki/PC_Screen_Font
+
* http://en.wikipedia.org/wiki/PC_Screen_Font
 
* {{nowrap|http://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html}}
 
* {{nowrap|http://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html}}
 
* https://git.kernel.org/cgit/linux/kernel/git/legion/kbd.git/tree/src/psf.h
 
* https://git.kernel.org/cgit/linux/kernel/git/legion/kbd.git/tree/src/psf.h
Line 59: Line 67:
 
* https://www.kernel.org/pub/linux/utils/kbd/
 
* https://www.kernel.org/pub/linux/utils/kbd/
 
* {{nowrap|http://www.ibiblio.org/pub/linux/system/keyboards/!INDEX.short.html}}
 
* {{nowrap|http://www.ibiblio.org/pub/linux/system/keyboards/!INDEX.short.html}}
 +
* {{nowrap|http://terminus-font.sf.net}}
 +
* Possible examples of (psf1) console fonts (including the required "8x16" <!--
 +
--> size) are {{nowrap|"console-data",}} {{nowrap|"console-setup-linux",}} <!--
 +
--> {{nowrap|"kbd-data",}} {{nowrap|"kbd-misc",}} "terminal", "terminus"...
 +
<!-- * About "eurlatgr" and {{nowrap|"latarcyrheb-sun16"}} fonts -->
 +
<!-- "[kbd] eurlatgr - new Linux console font" https://lists.altlinux.org/pipermail/kbd/2014-February/000439.html -->
 +
 +
<!--  -->
 +
<!-- The names of font files within font packages usually correspond to some kind of encoding. -->
 +
<!--  See the 'consolefonts/README.terminus' file as example. -->
 +
<!--  For reference, see: -->
 +
<!-- http://en.wikipedia.org/wiki/ISO/IEC_8859#The_parts_of_ISO.2FIEC_8859 -->
 +
<!--  and its table containing a comparison of characters: -->
 +
<!-- http://en.wikipedia.org/wiki/ISO/IEC_8859#Table -->
 +
<!--  -->
 +
 +
<!--  -->
 +
<!-- Additional useful info -->
 +
<!-- <nowiki>
 +
Preview of console fonts as PNGs (as web page and downloadable file):
 +
</br>Note: each image shows the corresponding characters sorted _vertically_
 +
with the first column on the left side and the last one on the right side.
 +
</br>Example:
 +
* First left-most _column_, upper half &rarr; positions 0 to 7.
 +
* First left-most _column_, lower half &rarr; positions 8 to 15.
 +
* 8<sup>th</sup> left-most _column_, lower half &rarr; positions 120 to 127 (0x07F).
 +
* When the font contains a total of 256 glyphs, --><!--
 +
--><!-- the {{nowrap|right-most}} upper corner shows the glyph in position 239, --><!--
 +
--><!-- while the {{nowrap|right-most}} lower corner shows the glyph in position 255 (0x0FF).
 +
* When the font contains a total of 512 glyphs, --><!--
 +
--><!-- the {{nowrap|right-most}} upper corner shows the glyph in position 495, --><!--
 +
--><!-- while the {{nowrap|right-most}} lower corner shows the glyph in position 511 (0x1FF).
 +
</br> https://alexandre.deverteuil.net/pages/consolefonts/
 +
    </nowiki> -->
 +
<!--  -->

Latest revision as of 15:14, 12 October 2018

FONT filename

"FONT" is a global directive that allows showing a set of glyphs (aka characters) different than the BIOS' default. Typically, the reason to use a font different than the BIOS' default is to be able to display (in the boot screen/menu) characters not included in the default set (i.e. different language). For example, for Nordic glyphs, the font would need to be based on the "DOS code page 865" (CP865); for Cyrillic → CP855, and so on. For basic usage of the FONT directive see Config#FONT.

The type/format of font file recognized by Syslinux is "PC Screen Font"; specifically "PSF1". Optionally, the font file can include a Unicode table too. In such case, the file name extension is frequently (but not always) ".psfu". The Unicode table is ignored by Syslinux.

Note: It is recommended to use DOS-compatible (aka "8.3") file names with Syslinux.

For the typical BIOS, the psf1 fonts should have the following properties:

  • fixed-width (aka monospace) bitmap font
  • width: 8 pixels per glyph
  • height: 16 pixels per glyph
  • 256 (or 512) glyphs (aka "codepoints") in one psf font file

The typical (default) boot screen results in:

width:          (  8 pixels ) x ( 80 columns ) = 640 
height:
     text mode: ( 16 pixels ) x ( 25 rows    ) = 400 
 graphics mode: ( 16 pixels ) x ( 30 rows    ) = 480 

Some font files can be found, among other places, in the "kbd" package. You can also search for font files in your "/usr/share/consolefonts/" or "/usr/share/kbd/consolefonts/" (or similar) path(s) in your OS. Additional font files can be downloaded, and font editors and converters are also available for various OSes (including DOS).


General info:

Tools and info:

Examples (there are many more, search the web):