Skip to content

Instantly share code, notes, and snippets.

@aldrienht
Last active August 5, 2016 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aldrienht/cdedca54a9398bdc6f7a3e12d7a222db to your computer and use it in GitHub Desktop.
Save aldrienht/cdedca54a9398bdc6f7a3e12d7a222db to your computer and use it in GitHub Desktop.
Matching System Font with your local environment and Amazon Linux
Step 1: Back up your EC2 System fonts.
cp -r /etc/fonts /etc/fonts.old
Step 2: Migrate your local font via SCP.
scp -r -i file.pem /etc/fonts ec2-user@ec2-x-x-x-x.ap-northeast-1.compute.amazonaws.com:/etc/fonts
Step 3: Reset Font Cache
fc-cache
fc-cache -v | grep err (to check errors)
*Note: If you encounter error with bitmap-fonts...
*The default config restricts the use of bitmap fonts, do the following.
sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf
sudo ln -s /etc/fonts/conf.avail/70-yes-bitmaps.conf /etc/fonts/conf.d/70-yes-bitmaps.conf
Do the reseting of cache, you shouldn't get any error after.
Step 4: Create a fonts/ folder in your application and fill it with the font(s) you want.
cd my_app_dir
mkdir fonts
Step 5: Create a .ebextensions directory and copy_fonts.config file:
mkdir .ebextensions
cd .ebextensions
vi copy_fonts.config
(paste the code below:)
container_commands:
copy_fonts:
command: "cp fonts/*.ttf /usr/share/fonts/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment