Getting Microsoft Calibri font on Amazon EC2 ubunt

2019-06-07 00:56发布

问题:

I am trying to use the Calibri font in JasperReports on my Amazon EC2 instance. How can I get this to work? I tried...

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

I need to be able to initiate a JVM from a PHP method which accesses this font for a report, but I don't have it on my server. How can I get it?

回答1:

Use

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

This will save Calibri font to your default fonts directory, and all your apps & scripts can use it as a normal font.



回答2:

After this I recommend to delete Calibri.ttf from ~/.fonts but may work without delete...

You need to add this to your sources list which is at "/etc/apt/sources.list" location:

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

(You can edit that for e.g. sudo nano /etc/sources.list)

Then you can install the packege with this command from terminal:

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

This will download & install...