summaryrefslogtreecommitdiffstats
path: root/fontconfig/lang-match-check
blob: 2fc7acbc8e69ab33c50e779aeccb23f281c938f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh

[ $# -lt 4 ] && echo "Usage: $(basename $0) <package name> <lang|..> <font name> <sans|serif|monospace>" && exit 1

_loclist=$(for i in $(echo $2|sed -e 's/|/ /g'); do echo -n "$(echo $i|sed -e 's/@.*//g') "; done|sed -e 's/ /|/g'|sed -e 's/|$//g')
loclist="en|en-us|$_loclist"
_fullloclist=$(echo "$_loclist|$2"|sed -e "s/|/\n/g"|sort|uniq)
_fullloclist=$(echo $_fullloclist|sed -e 's/ /|/g')
fullloclist="en|en-us|$_fullloclist"
echo "# rpm -qa $1"
rpm -qa $1
fclanglist=$(for i in $(echo $_fullloclist|sed -e 's/|/ /g') $(localedef --list | grep -E "^($_loclist)_" | sed -e 's/\.[^@].*//g' -e 's/\(.*\)_\([^@]*\)\(.*\)/\1-\2\3/g' | sort | uniq | tr '[:upper:]' '[:lower:]'); do echo $i;done|sort)
fclanglist="en en-us $fclanglist"
for i in monospace sans serif; do for j in $fclanglist; do echo "# fc-match $i:lang=$j"; fc-match $i:lang=$j; done; done
echo "# for i in \$(ls /usr/share/locale|grep -v -E \"^($_fullloclist)\$\"); do fc-match $4:lang=\$i|grep \"$3\"; [ \$? = 0 ] && echo \$i; done"
for i in $(ls /usr/share/locale|grep -v -E "^($2)$"); do fc-match $4:lang=$i|grep "$3"; [ $? = 0 ] && echo $i; done