7
|
1 " Vim syntax file
|
375
|
2 " Language: BDF font definition
|
839
|
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
|
|
4 " Latest Revision: 2006-04-19
|
7
|
5
|
375
|
6 if exists("b:current_syntax")
|
7
|
7 finish
|
|
8 endif
|
|
9
|
375
|
10 let s:cpo_save = &cpo
|
|
11 set cpo&vim
|
7
|
12
|
375
|
13 syn region bdfFontDefinition transparent matchgroup=bdfKeyword
|
|
14 \ start='^STARTFONT\>' end='^ENDFONT\>'
|
|
15 \ contains=bdfComment,bdfFont,bdfSize,
|
|
16 \ bdfBoundingBox,bdfProperties,bdfChars,bdfChar
|
|
17
|
|
18 syn match bdfNumber contained display
|
|
19 \ '\<\%(\x\+\|[+-]\=\d\+\%(\.\d\+\)*\)'
|
|
20
|
|
21 syn keyword bdfTodo contained FIXME TODO XXX NOTE
|
7
|
22
|
375
|
23 syn region bdfComment contained start='^COMMENT\>' end='$'
|
|
24 \ contains=bdfTodo,@Spell
|
|
25
|
|
26 syn region bdfFont contained matchgroup=bdfKeyword
|
|
27 \ start='^FONT\>' end='$'
|
|
28
|
|
29 syn region bdfSize contained transparent matchgroup=bdfKeyword
|
|
30 \ start='^SIZE\>' end='$' contains=bdfNumber
|
7
|
31
|
375
|
32 syn region bdfBoundingBox contained transparent matchgroup=bdfKeyword
|
|
33 \ start='^FONTBOUNDINGBOX' end='$'
|
|
34 \ contains=bdfNumber
|
7
|
35
|
375
|
36 syn region bdfProperties contained transparent matchgroup=bdfKeyword
|
|
37 \ start='^STARTPROPERTIES' end='^ENDPROPERTIES'
|
|
38 \ contains=bdfNumber,bdfString,bdfProperty,
|
|
39 \ bdfXProperty
|
7
|
40
|
375
|
41 syn keyword bdfProperty contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
|
|
42 syn match bdfProperty contained '^\S\+'
|
7
|
43
|
375
|
44 syn keyword bdfXProperty contained FONT_ASCENT FONT_DESCENT DEFAULT_CHAR
|
|
45 \ FONTNAME_REGISTRY FOUNDRY FAMILY_NAME
|
|
46 \ WEIGHT_NAME SLANT SETWIDTH_NAME PIXEL_SIZE
|
|
47 \ POINT_SIZE RESOLUTION_X RESOLUTION_Y SPACING
|
|
48 \ CHARSET_REGISTRY CHARSET_ENCODING COPYRIGHT
|
|
49 \ ADD_STYLE_NAME WEIGHT RESOLUTION X_HEIGHT
|
|
50 \ QUAD_WIDTH FONT AVERAGE_WIDTH
|
|
51
|
|
52 syn region bdfString contained start=+"+ skip=+""+ end=+"+
|
|
53
|
|
54 syn region bdfChars contained display transparent
|
|
55 \ matchgroup=bdfKeyword start='^CHARS' end='$'
|
|
56 \ contains=bdfNumber
|
7
|
57
|
375
|
58 syn region bdfChar transparent matchgroup=bdfKeyword
|
|
59 \ start='^STARTCHAR' end='^ENDCHAR'
|
|
60 \ contains=bdfEncoding,bdfWidth,bdfAttributes,
|
|
61 \ bdfBitmap
|
7
|
62
|
375
|
63 syn region bdfEncoding contained transparent matchgroup=bdfKeyword
|
|
64 \ start='^ENCODING' end='$' contains=bdfNumber
|
7
|
65
|
375
|
66 syn region bdfWidth contained transparent matchgroup=bdfKeyword
|
|
67 \ start='^SWIDTH\|DWIDTH\|BBX' end='$'
|
|
68 \ contains=bdfNumber
|
7
|
69
|
375
|
70 syn region bdfAttributes contained transparent matchgroup=bdfKeyword
|
|
71 \ start='^ATTRIBUTES' end='$'
|
7
|
72
|
375
|
73 syn keyword bdfBitmap contained BITMAP
|
7
|
74
|
|
75 if exists("bdf_minlines")
|
|
76 let b:bdf_minlines = bdf_minlines
|
|
77 else
|
375
|
78 let b:bdf_minlines = 30
|
7
|
79 endif
|
375
|
80 exec "syn sync ccomment bdfChar minlines=" . b:bdf_minlines
|
|
81
|
7
|
82
|
375
|
83 hi def link bdfKeyword Keyword
|
|
84 hi def link bdfNumber Number
|
|
85 hi def link bdfTodo Todo
|
|
86 hi def link bdfComment Comment
|
|
87 hi def link bdfFont String
|
|
88 hi def link bdfProperty Identifier
|
|
89 hi def link bdfXProperty Identifier
|
|
90 hi def link bdfString String
|
|
91 hi def link bdfChars Keyword
|
|
92 hi def link bdfBitmap Keyword
|
7
|
93
|
|
94 let b:current_syntax = "bdf"
|
|
95
|
375
|
96 let &cpo = s:cpo_save
|
|
97 unlet s:cpo_save
|