Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

Commit

Permalink
linux: Create install.sh for Bitstream Vera conf
Browse files Browse the repository at this point in the history
For #17
Fixes #14
  • Loading branch information
13rac1 committed Mar 21, 2016
1 parent e7eed4a commit ac15ea4
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Emoji One Color SVGinOT Font
Fontconfig fonts.conf for a Bitstream Vera default
<fontconfig>
<!--
Emoji One Color SVGinOT Font
https://github.com/eosrei/emojione-color-font
https://github.com/eosrei/emojione-color-font
The DejaVu font family is based on the Bitstream Vera font family to provide
greater unicode coverage. The only way to override the emoji it includes is
to make the emoji font the primary system font. This shouldn't be a problem,
but a number of programs do not correctly use font fallback resulting in font
rendering errors everywhere.
The DejaVu font family is based on the Bitstream Vera font family to provide
greater unicode coverage. The only way to override the emoji it includes is
to make the emoji font the primary system font. This shouldn't be a problem,
but a number of programs do not correctly use font fallback resulting in font
rendering errors everywhere.
This font.conf makes Bitstream Vera the default font for Serif, Sans-Serif,
and Monospace font requests since it does not contain any Unicode Emoji
characters. Emoji One Color font is the first fallback, followed by DejaVu
to provide everything else.
This font.conf makes Bitstream Vera the default font for Serif, Sans-Serif,
and Monospace font requests since it does not contain any Unicode Emoji
characters. Emoji One Color font is the first fallback, followed by DejaVu
to provide everything else.
Test with:
fc-match -s serif
fc-match -s sans-serif
fc-match -s monospace
-->
Install required fonts with:
sudo apt-get install ttf-bitstream-vera
Test with:
fc-match -s serif
fc-match -s sans-serif
fc-match -s monospace
-->
<fontconfig>
<match target="font">
<!-- If the requested font is Bitstream Vera Serif -->
<test name="family" compare="eq">
Expand Down
46 changes: 46 additions & 0 deletions linux/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh
#https://github.com/eosrei/emojione-color-font
echo "Emoji One Color font installer for Linux\n"

# Check for Bitstream Vera
fc-list | grep "Bitstream Vera" > /dev/null
RETURN=$?
if [ $RETURN -ne 0 ];then
echo "Bitstream Vera font family not found. Please install it:"
echo "sudo apt-get install ttf-bitstream-vera"
exit 1
fi
echo "NOTE: Changing default font family to Bitstream Vera"

# Stop on errors
set -e
# Set XDG_DATA_HOME to default if empty.
if [ -z "$XDG_DATA_HOME" ];then
XDG_DATA_HOME=$HOME/.local/share
fi

# Remove font from old directory if exists (temporary backwards compat)
if [ -f ~/.fonts/EmojiOneColor-SVGinOT.ttf ];then
echo "Removing the font from ~/.fonts"
rm ~/.fonts/EmojiOneColor-SVGinOT.ttf
fi

# Create a user font directory
mkdir -p $XDG_DATA_HOME/fonts
echo "Installing the font in: $XDG_DATA_HOME/fonts/"
cp EmojiOneColor-SVGinOT.ttf $XDG_DATA_HOME/fonts/
# Create a font config directory
FONTCONFIG=$HOME/.config/fontconfig
mkdir -p $FONTCONFIG
# Check for an existing font config
if [ -f $FONTCONFIG/fonts.conf ];then
echo "Existing fonts.conf backed up to fonts.bak"
cp $FONTCONFIG/fonts.conf $FONTCONFIG/fonts.bak
fi
# Install fonts.conf
cp fontconfig/user-bitstream-vera-fonts.conf $FONTCONFIG/fonts.conf

echo "Clearing font cache"
fc-cache -f

echo "Done!"

0 comments on commit ac15ea4

Please sign in to comment.