在Amazon EC2 ubuntu上获取Microsoft Calibri字体

时间:2012-10-19 21:40:32

标签: ubuntu amazon-ec2 jasper-reports

我正在尝试在我的Amazon EC2实例上使用JasperReports中的Calibri字体。我怎样才能让它发挥作用?我试过......

sudo apt-get install ttf-mscorefonts-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package ttf-mscorefonts-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ttf-mscorefonts-installer' has no installation candidate

我需要能够从PHP方法启动JVM,该方法访问此字体以获取报告,但我的服务器上没有它。我怎么能得到它?

2 个答案:

答案 0 :(得分:1)

使用

wget "http://cl.ly/0m3f0x0c252P3O3t190q/download/Calibri.ttf" -O "~/.fonts/Calibri.ttf"

这会将Calibri字体保存到您的默认字体目录,以及您的所有应用程序&脚本可以将它用作普通字体。

答案 1 :(得分:0)

在此之后我建议从〜/ .fonts中删除Calibri.ttf,但可以在没有删除的情况下工作......

您需要将此添加到位于“/etc/apt/sources.list”位置的来源列表:

deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse

(您可以对其进行修改,例如sudo nano /etc/sources.list

然后你可以从终端使用这个命令安装packege:

sudo apt-get install -y ttf-mscorefonts-installer

这将下载&安装...