sebastiencs / icons-in-terminal

Use any fonts in the terminal without replacing or patching
MIT License
984 stars 46 forks source link

Malformed 30-icons.conf for fonts containing special characters #24

Open volca02 opened 4 years ago

volca02 commented 4 years ago

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;/'`
volca02 commented 4 years ago

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