Font installation causing browser problems

Write tutorials and howtos in here

Font installation causing browser problems

Postby Left_Guard on Mon Nov 02, 2009 2:48 pm

I'm having some browser problems after installing a slew of .ttf fonts on my Mint 7 system.

After
Code: Select all
sudo cp /home/user/*.ttf /usr/share/fonts/truetype
and
Code: Select all
sudo fc-cache -f
the fonts work fine in my applications and also through my LAMP setup.
Unfortunately it screws up the browser windows (I've tried Firefox and Opera) on every other users login.
For example turning
Before.png
Before.png (165.18 KiB) Viewed 36 times

into
After.png
After.png (126.48 KiB) Viewed 36 times


However, removing the fonts, updating the cache, and cp-ing the fonts into a .fonts folder in my home directory means they don't work through my LAMP setup (pages I create don't display with the fonts anymore.)

I'm assuming, given that my browser is unaffected, that it's a problem with file permissions.
Any suggestions?
Left_Guard
Level 1
Level 1
 
Posts: 3
Joined: Mon Nov 02, 2009 12:52 pm

Linux Mint is funded by ads and donations.
 

Re: Font installation causing browser problems

Postby DrHu on Mon Nov 02, 2009 3:40 pm

Left_Guard wrote:However, removing the fonts, updating the cache, and cp-ing the fonts into a .fonts folder in my home directory means they don't work through my LAMP setup (pages I create don't display with the fonts anymore.)

And between those steps; you either rebooted
best, since it will restart Xserver, or login or logout/login again
    Copy ttf fonts into .fonts in /home
    Starting LAMP stack

And you haven't said directly whether or not with those fonts (ttf) in your /home ..fonts, if Firefox displays the fints correctly or not, and you are using unicode as the Firefox>Preferences>Contents TAB, font selection best for font support
--I wouldn't be using windows keymaps windows 1259 etc..

I only use mstcorefonts for web pages, a slew of fonts is probably not necessary or even useful on web pages, and even in the DTP (DeskTop Publishling) realm, too many fonts or font selections or changes is counter productive..
--just like odd web page colors
    i A ttf-mscorefonts-installer - Installer for Microsoft TrueType core font
User avatar
DrHu
Level 8
Level 8
 
Posts: 2400
Joined: Thu Jun 18, 2009 1:20 am

Re: Font installation causing browser problems

Postby Left_Guard on Wed Nov 04, 2009 2:52 pm

Thanks for reply.

I've used JAVA, but am learning to use PHP and so have installed LAMP on the family's Mint 7 laptop. (Good God, it's so easy to do!) I also have msttcorefonts installed.
I do lots of DTP and, you're right, I don't use the vast majority of the fonts I have. Nevertheless, I do like scouting through them occasionally, if I can't find one that's 'just right' for what I want in the one's I regularly use. I thought it would be possible to 'dress up' any LAMP apps I wrote for myself once I got proficient enough. Any I wrote that I might want to show off to others would need to be written with the core fonts in mind.

I've tried a couple more times just cp-ing the fonts in and updating the cache, and still can't do it without it messing up the other's browsers. Even after logout-login, or restart. My browser is always unaffected.
Dropping the fonts into home/.fonts stops them working in any PHP pages I produce.

However...

I decided to try downloading some different fonts, from http://www.1001freefonts.com, put them into /usr/share/fonts, and recached. Bingo everything still works and I can use the fonts in my PHP pages.
I did an ls of the directory I have archived all the fonts in, though, and noticed the three new fonts were displayed differently. (See picture)
Screenshot.png
Screenshot.png (14.27 KiB) Viewed 25 times

I still don't know enough about file permissions, being newer than some to Linux, but as far as I know the font used in the terminal is dependent on various file properties.
Thinking that it might be the permission present on the other fonts, I tried copying just one across...

It worked.

I now have a funny feeling that, until I more fully understand file permissions, I'm only going to be able to do this one font at a time, checking as I go.
Am I on the right track?
Left_Guard
Level 1
Level 1
 
Posts: 3
Joined: Mon Nov 02, 2009 12:52 pm

Re: Font installation causing browser problems

Postby Left_Guard on Wed Nov 04, 2009 11:10 pm

Done it!

Problem WAS with file permissions.

Code: Select all
ls -l /home/Left_Guard/fontarchive

revealed all but the three new fonts were listed as
-rwx------ 1 root root [file size] [modification date] [name]
the other three were listed as
-rw-r--r-- 1 Left_Guard Left_Guard [file size] [modification date] [name]
after which

Code: Select all
cd /home/Left_Guard/fontarchive
sudo chown Left_Guard Left_Guard *
chmod u-x,g+r,o+r *
sudo cp /home/Left_Guard/fontarchive/*.ttf /usr/share/fonts/truetype/winfonts/
sudo fc-cache -f

worked fine!

Logout-login to anyone else's account and their browsers are displaying properly.
Any pages I produce using PHP also display the fonts in my browser.

Much help on file permissions is at http://www.freeos.com/articles/3127/
Left_Guard
Level 1
Level 1
 
Posts: 3
Joined: Mon Nov 02, 2009 12:52 pm


Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 1 guest