NSX (QFont)
Line 25: | Line 25: | ||
Should be the first groups of file, it sets font drawer and face group. | Should be the first groups of file, it sets font drawer and face group. | ||
− | ==== type ''x'' ==== | + | ==== type=''x'' ==== |
Type of font drawer, each of it has it's advantages and disadvantages: | Type of font drawer, each of it has it's advantages and disadvantages: | ||
Line 33: | Line 33: | ||
* ''glyph'' - QuakeC glyph font renderer (each char is separatepic). | * ''glyph'' - QuakeC glyph font renderer (each char is separatepic). | ||
− | ==== face ''path'' ==== | + | ==== face=''path'' ==== |
Path to the font face group. | Path to the font face group. | ||
− | ==== brightness ''x'' ==== | + | ==== brightness=''x'' ==== |
Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc. | Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc. | ||
Line 42: | Line 42: | ||
Applies to all renderer types. | Applies to all renderer types. | ||
− | ==== scale ''x'' ''y'' ==== | + | ==== scale=''x'' ''y'' ==== |
Two floating point values storing horizontal and vertical scale of font chars. | Two floating point values storing horizontal and vertical scale of font chars. | ||
Line 48: | Line 48: | ||
Applies to all renderer types. | Applies to all renderer types. | ||
− | ==== width ''x'' ==== | + | ==== width=''x'' ==== |
X component of scale. | X component of scale. | ||
− | ==== height ''y'' ==== | + | ==== height=''y'' ==== |
Y component of scale. | Y component of scale. | ||
− | ==== respath ''path'' ==== | + | ==== respath=''path'' ==== |
Path to font resources. Default path is sub-folder named as qfont file without extension. | Path to font resources. Default path is sub-folder named as qfont file without extension. | ||
Line 62: | Line 62: | ||
== face group for freetype font == | == face group for freetype font == | ||
− | ==== sizes | + | ==== sizes=''size1 size2 size3...'' ==== |
Which glyph sizes to render (for different size fonts). | Which glyph sizes to render (for different size fonts). | ||
Line 68: | Line 68: | ||
Default value is "16 24". | Default value is "16 24". | ||
− | ==== slot | + | ==== slot=''x'' ==== |
Engine font slot. Used to replace fontmaps that was already initialized. | Engine font slot. Used to replace fontmaps that was already initialized. | ||
Line 74: | Line 74: | ||
Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar, menu, user0, user1, user2, user3, user4, user5, user6, user7. | Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar, menu, user0, user1, user2, user3, user4, user5, user6, user7. | ||
− | ==== glyphs | + | ==== glyphs=''string'' ==== |
Engine will render font pages containing this string chars. | Engine will render font pages containing this string chars. | ||
− | ==== r_antialias | + | ==== r_antialias=''0/1'' ==== |
Toggles antialiasing for font pages renderer. | Toggles antialiasing for font pages renderer. | ||
− | ==== r_hinting | + | ==== r_hinting=''0/1/2/3'' ==== |
Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting. | Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting. | ||
+ | |||
Revision as of 19:28, 2 July 2012
Contents |
Introduction
.QFONT files are .NSX scripts that holds parameters for NetherMenu font draw module.
Example of .QFONT file contents:
[qfont] type=FT face=default brightness=0.8 width=1.2 [default] file=./big.ttf sizes=38 glyphs=abcdefghijklmnopqrttuvwxyz0123456789 r_shadow=0.8 r_shadowblur=1 r_shadowofs=0 0.5 0.5
Structure
[qfont] group
Should be the first groups of file, it sets font drawer and face group.
type=x
Type of font drawer, each of it has it's advantages and disadvantages:
Possible values:
- ft - Darkplaces vector fonts using freetype library
- ascii - Quake ascii conchars (256 chars on a 16*16 table)
- glyph - QuakeC glyph font renderer (each char is separatepic).
face=path
Path to the font face group.
brightness=x
Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
Applies to all renderer types.
scale=x y
Two floating point values storing horizontal and vertical scale of font chars.
Applies to all renderer types.
width=x
X component of scale.
height=y
Y component of scale.
respath=path
Path to font resources. Default path is sub-folder named as qfont file without extension.
face group for freetype font
sizes=size1 size2 size3...
Which glyph sizes to render (for different size fonts).
Default value is "16 24".
slot=x
Engine font slot. Used to replace fontmaps that was already initialized.
Darkplaces engine have this fixed slots: default, console, sbar, notify, chat, centerprint, infobar, menu, user0, user1, user2, user3, user4, user5, user6, user7.
glyphs=string
Engine will render font pages containing this string chars.
r_antialias=0/1
Toggles antialiasing for font pages renderer.
r_hinting=0/1/2/3
Toggles hinting for font pages renderer. 0 - no hinting, 1 - light autohintinh, 2 - full autohinting, 3 - full hinting.
if (key == "r_antialias") { r_antialias = stof(val); continue; }
if (key == "r_hinting") { r_hinting = stof(val); continue; }
if (key == "r_shadow") { r_outline = stof(val); continue; }
if (key == "r_shadowblur") { r_outlineblur = stof(val); continue; }
if (key == "r_shadowofs") { r_outlineofs = stov(val); continue; }
if (key == "r_charcushion"){ r_charcushion = stof(val); continue; }
if (key == "r_charscale") { r_charscale = stof(val); continue; }