how to use Calibri font in linux and mac

2019-05-20 23:27发布

问题:

My project have all its text in calibri my choice, its working perfect in Window o.s in all major browser, but when we try to deploy the same project on Linux or Mac the font style (font family,size)changes and take some other form, it looks weird. Its known that TTF(True Type Fonts) are made for all O.S. Till now, I got the copy paste method to copy the file of calibri from Windows to linux but its not worthful for me.

I want it to be general not just for a particular system.

回答1:

There is absolutely no technical problem installing Calibri on Linux, either system-wide or per user (see fontconfig documentation, for example https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/International_Language_Support_Guide/add_fonts_all_users.html )

If that does not work it means your software is using some obsolete legacy pre-fontconfig text stack and that is going to break one way or another on most Linux systems (since Linux maintained compatibility with old systems for a very long time a lot of cross-platform toolkits skimped on moving to fontconfig and as a result they break right and left with modern fonts and their rendering sucks).

Otherwise you can expose it as an opentype web font which will work pretty much on any browser except old IE (but those will have it on-system).

However regardless of the method you choose Calibri is a commercial font and to do it legally you'll need to license it. And that will be very expensive. Just because it's pre-installed on windows does not mean it is free.



回答2:

you have it looking right on your windows machine because the calibri font is on your system. macs, for example, have no calibri in the system fonts, that's why it renders with another font, which is exactly the second one you choose on your style sheet. you probably have something like this in you css file:

font-family: calibri, arial;

if the system has no calibri, the fonts will be rendered in arial.

calibri is a licensed font you can buy: http://www.fonts.com/font/microsoft-corporation/calibri?QueryFontType=Web&src=GoogleWebFonts

i'd suggest you to use something that looks like it on google free web fonts: https://www.google.com/fonts