zsh-workers
 help / color / mirror / code / Atom feed
991838d67f10e6a01e4d5775776cc31165f5277a blob 1354 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
#compdef fc-list fc-match

local -a expl suf
local font=${${PREFIX//-[0-9]##:/:}%:*}: ret=1
local attr

compset -S ':*' || suf=( -S: -r "-: \t\n\-" )
if compset -P '*:'; then
  attr="${PREFIX%\=*}"
  if compset -P '*='; then
    case $attr in
      hintstyle)
        _wanted value expl 'value' compadd "$suf[@]" \
	    hint{none,slight,medium,full} && ret=0
      ;;
      *)
        _wanted value expl 'value' compadd "$suf[@]" \
            ${${(f)"$(_call_program font-attrs
	    fc-list $font $attr 2>/dev/null)"//,/$'\n'}##*=} && ret=0
      ;;
    esac
  else
    _tags elements {weight,slant}-constants
    while _tags; do
      _requested elements expl element compadd -qS= hintstyle hinting autohint \
          size ${${(u)${(M)${(f)"$(_call_program elements
	  fc-list -v $font 2>/dev/null)"}:#	[a-z]*}%%:*}#?} && ret=0
      _requested weight-constants expl 'weight constant' compadd "$suf[@]" \
          thin bold regular medium semibold heavy roman && ret=0
      _requested slant-constants expl 'slant constant' compadd "$suf[@]" \
          roman italic oblique && ret=0

      (( ret )) || break
    done
  fi
elif compset -P '*[^\\]-'; then
  _message -e size 'point size' && ret=0
else
  _wanted fonts expl font compadd "$suf[@]" \
      ${(us:,:)$(_call_program fonts fc-list -f '%\{family\},' 2>/dev/null)} && ret=0
fi

return ret
debug log:

solving 991838d67 ...
found 991838d67 in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).