NSX (QFont)

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
= Introduction =
+
[[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.
  
QFONT files are [[NSX|NSX scripts]] that holds parameters for [[NetherMenu]] font draw module.
+
Example QFONT file:
 
+
Example of .QFONT file contents:
+
  
 
  ''[qfont]''
 
  ''[qfont]''
Line 19: Line 17:
 
  r_shadowofs=0 0.5 0.5
 
  r_shadowofs=0 0.5 0.5
  
= Structure =
+
== Structure ==
 
+
== [qfont] group ==
+
 
+
Should be the first groups of file, it sets font drawer and face group.
+
  
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
! width=6% bgcolor=#EEDFDF  | Key pair
+
! width=6% | Key pair
! width=83% bgcolor=#EEDFDF | Description
+
! width=83% | Description
 +
|-
 +
| '''[qfont]'''
 +
| Should be the first groups of file.
 
|-
 
|-
 
|'''type'''=''x''
 
|'''type'''=''x''
Line 33: Line 30:
  
 
Possible values:
 
Possible values:
* ft - Darkplaces vector fonts using freetype library
+
* FT - Darkplaces vector fonts using freetype library
* ascii - Quake ascii conchars (256 chars on a 16*16 table)
+
* ASCII - Quake ascii conchars (256 chars on a 16*16 table)
* glyph - QuakeC glyph font renderer (each char is separate picture).
+
* GLYPH - QuakeC glyph font renderer (each char is separate picture)
 
|-
 
|-
 
|'''face'''=''string''
 
|'''face'''=''string''
Line 53: Line 50:
 
|-
 
|-
 
|'''respath'''=''path''
 
|'''respath'''=''path''
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file.
+
|Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be ''gfx/myfont/'').
 
|}
 
|}
  
== Freetype font face group ==
+
{{hidden begin | Freetype font face group }}
  
 
Attributes of font face for freetype font renderer.
 
Attributes of font face for freetype font renderer.
  
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
! width=6% bgcolor=#EEDFDF | VKey pairlue
+
! width=6% | Key pair
! width=83% bgcolor=#EEDFDF | Description
+
! width=83% | Description
 
|-
 
|-
 
|'''file'''=''path''
 
|'''file'''=''path''
Line 98: Line 95:
 
|Characters uniform scale.
 
|Characters uniform scale.
 
|}
 
|}
 +
{{hidden end}}
  
== Glyph font face group ==
+
{{hidden begin | Glyph font face group }}
  
 
Attributes of font face for glyph font renderer.
 
Attributes of font face for glyph font renderer.
  
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
 
{| border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse; width:100%"
! width=6% bgcolor=#EEDFDF | Key pair
+
! width=6% | Key pair
! width=83% bgcolor=#EEDFDF | Description
+
! width=83% | Description
 
|-
 
|-
 
|'''respath'''=''path''
 
|'''respath'''=''path''
Line 113: Line 111:
 
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
 
|Value is a string of: ''picture'' kern ''left'' ''right'' '''codes''' ''code1'' ''code2'' ''codeX''. Kern parmeter is optional. One pic may have many ASCII codes.
 
|}
 
|}
 +
{{hidden end}}
  
 +
[[Category:File formats]]
  
= Glyph vs Ascii vs Freetype =
+
__NOTOC__
 
+
Reason all that groups exists is that all of them was maked for different tasks.
+
 
+
Freetype is best at covering GUI's. ASCII is simple, and Glyph is versatile since it's purely QC-based.
+
 
+
 
+
[[Category:File formats]]
+

Latest revision as of 01:57, 18 July 2012

NSX scripts that holds parameters for NetherMenu font draw module.

Example QFONT file:

[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

[edit] Structure

Key pair Description
[qfont] Should be the first groups of file.
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 separate picture)
face=string Font face. For freetype and glyph font renderers this is name of group. For Ascii it's a path to conchars texture.
brightness=value Floating point value of brightness scale. 1 is nothing, 0.1 is 10% etc.
scale=x y Two floating point values storing horizontal and vertical scale of font chars.
width=x X component of scale.
height=y Y component of scale.
respath=path Path to font resources. Could be relative (if begins with ./) or absolute (from gamedir). Default is subfolder named as font file (i.e if font file is gfx/myfont.qfont, it's default resources directory will be gfx/myfont/).
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox