EC2实例上安装特定字体

EC2实例上安装特定字体

本文介绍了如何在我的AWS EC2实例上安装特定字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在AWS EC2(Amazon Linux,Elastic Beanstalk)实例上的Python应用程序,它需要某些特定的字体来产生输出,并想知道如何将它们安装作为部署或实例启动过程的一部分。 b
$ b我的代码运行在本地机器上(OS X)使用
$ b $ pre $ 'Arial Unicode MS'
'打开Sans'

作为字体。但是这些字体在EC2上默认不存在(我只看到 / usr / share / fonts 中的DejavuSans和DejvuSerif),而且我不清楚哪些包可能包括我需要的字体,或者如何安装。



如何在EC2上安装这两种字体,最好使用 yum 命令 container_command > .ebextensions / * .config file?

解决方案

这是一个老问题,回答它,以下工作适合我。



在您的应用程序中创建一个字体/文件夹,并填写您想要的字体。创建一个如下所示的.ebextensions / copy_fonts.config文件:

  container_commands:
copy_fonts:
命令:cp fonts / *。ttf / usr / share / fonts /


I have a Python application running on an AWS EC2 (Amazon Linux, Elastic Beanstalk) instance that requires certain specific fonts to produce output and wonder how to install them as part of the deployment or instance launching process.

My code, running on my local machine (OS X) uses

'Arial Unicode MS'
'Open Sans'

as fonts. But these fonts are not present by default on EC2 (I only see DejavuSans and DejvuSerif in /usr/share/fonts), and it is not clear to me either what packages might include the fonts I need, or how to install them.

How do I install those two fonts on EC2, preferably using yum or a command or container_command as part of the deployment/instaitation process specified on an .ebextensions/*.config file?

解决方案

This is an old question but since no one answered it, the following worked for me.

Create a fonts/ folder in your application and fill it with the font(s) you want. Create a .ebextensions/copy_fonts.config file that looks like:

container_commands:
    copy_fonts:
        command: "cp fonts/*.ttf /usr/share/fonts/"

这篇关于如何在我的AWS EC2实例上安装特定字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 03:27