Start work on documenting the conf file

This commit is contained in:
Kovid Goyal
2018-06-03 16:07:40 +05:30
parent 3ce9e1932c
commit 9dc9fb2012
6 changed files with 296 additions and 35 deletions

69
kitty/config_data.py Normal file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env python
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from gettext import gettext as _
from .conf.definition import option_func
MINIMUM_FONT_SIZE = 4
def to_font_size(x):
return max(MINIMUM_FONT_SIZE, float(x))
all_options = {}
o, g, all_groups = option_func(all_options, {
'fonts': [
_('Fonts'),
_('kitty has very powerful font management. You can configure individual\n'
'font faces and even specify special fonts for particular characters.')
],
})
type_map = {o.name: o.option_type for o in all_options.values()}
g('fonts') # {{{
o(
'font_family',
'monospace',
_('Font family'),
long_text=_('''
You can specify different fonts for the bold/italic/bold-italic variants.
By default they are derived automatically, by the OSes font system. Setting
them manually is useful for font families that have many weight variants like
Book, Medium, Thick, etc. For example::
font_family Operator Mono Book
bold_font Operator Mono Medium
italic_font Operator Mono Book Italic
bold_italic_font Operator Mono Medium Italic
''')
)
o('bold_font', 'auto')
o('italic_font', 'auto')
o('bold_italic_font', 'auto')
o('font_size', 11.0, _('Font size (in pts)'), option_type=to_font_size)
o(
'+symbol_map',
'U+E0A0-U+E0A2,U+E0B0-U+E0B3 PowerlineSymbols',
_('Font character mapping'),
add_to_default=False,
long_text=_('''
Map the specified unicode codepoints to a particular font. Useful if you need
special rendering for some symbols, such as for Powerline. Avoids the need for
patched fonts. Each unicode code point is specified in the form :code:`U+<code point
in hexadecimal>`. You can specify multiple code points, separated by commas and
ranges separated by hyphens. :code:`symbol_map` itself can be specified multiple times.
Syntax is::
symbol_map codepoints Font Family Name
'''))
# }}}