source: trunk/game/fonts/ @ 828

Revision 828, 786 bytes checked in by barra_parpg, 9 years ago (diff)

Patch by aspidites:

  • renamed all Directory options to Path for brevity and consistency
  • no longer sets absolute paths as this was crashing fife
  • no longer errors out on file read. instead, it errors out only if system.cfg isn't found and displays a useful help message
  • added a settings_path argument to to compensate for the fact that on linux, the settings file is not in the same location as the other data files
  • no longer takes a -p option. instead, 1 to 3 filenames are taken as required arguments
  • subclassed pychan's Font object to create PARPGFont, which is arguably more flexible
  • instead of taking a fontdef file, it takes a settings object as well as a python dictionary called fontdef
  • created three fontdef modules in /fonts to assist in creation of the forementioned fontdef dictonaries.
  • one needs only copy the file, rename it, and change the name option to create a new fontdef
  • because of the above changes, the fontspath is not configurable
1""" Font definition module
2    To create a new font definition, simply copy this file into a new one
3    and change the name and sizes variables.
5    While not strictly necessary, you may also change the options in the base
6    dictionary for more fine-grained control.
9# Must edit for new fonts
10name = 'RPG Font'
13# Optional parameters for new font
14# 12 pt Font is included y default, so there is no need to add it here
15sizes = [8, 9, 10]
16base = dict(
17    typename = 'truetype',
18    antialias = 1,
19    color = [0, 0, 0]
22# DO NOT Change anything below this line
23fontdefs = [{'name': name, 
24             'size': 12}] + [{'name': '{0}_{1}'.format(name, size),
25                              'size': size} for size in sizes]
27[fontdef.update(base) for fontdef in fontdefs[:]]
Note: See TracBrowser for help on using the repository browser.