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