sebastiencs / icons-in-terminal

Use any fonts in the terminal without replacing or patching

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Malformed 30-icons.conf for fonts containing special characters

volca02 opened this issue · comments

I have B&H LucidaTypewriter font installed in system. After running install.sh, the fc-cache command fails with:

Fontconfig error: "/home/volca/.config/fontconfig/conf.d/30-icons.conf", line 9: not well-formed (invalid token)

with the reason being this line

<alias><family>B&H LucidaTypewriter</family><prefer><family>icons-in-terminal</family></prefer></alias>

I think the FONT_NAME variable needs to be urlencoded before producing the line in fontconfig file.

For me, this quick and dirty change in generate_fontconfig.sh worked, but assumes sed is installed:

    FONT_NAME=`echo $FONT_NAME | tr -d '\n' | sed -e 's/&/&amp;/'`

That hotfix is clearly not enough for all possible cases, some other special characters will need to be urlencoded as well.