LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2015, 08:29 PM   #1
chris319
Member
 
Registered: Jun 2003
Distribution: Linux Mint
Posts: 103

Rep: Reputation: 16
Font Permissions


Hello -

In Linux Mint I have installed some new fonts in the usr/share/truetype folder. To make them visible to my non-root account, in permissions I have set the Group to my user account name, e.g. "myAccount" and ran fc-cache. All works well.

My question is, what if I wanted more user accounts to be able to use these fonts than just the one I have selected in "Group"? I don't see an entry for "All Users".

Thank you.
 
Old 10-06-2015, 02:50 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Xubuntu, Manjaro
Posts: 745
Blog Entries: 3

Rep: Reputation: 347Reputation: 347Reputation: 347Reputation: 347
Hi there!

I dont know how to do it using the GUI in Linux Mint, but from a command line, you can give everybody ('o' = others) the right to read a file or a directory with:
Code:
chmod o+r /path/to/file
For example. Consider this file:
Code:
-rw-r-----   1 HMW  staff       0  6 Okt 08:46 foobar
User has read & write (rw) permissions and group has read (r) permission. To allow everybody to read, issue this:
Code:
chmod o+r foobar
And now...
Code:
-rw-r--r--   1 HMW  staff       0  6 Okt 08:46 foobar
Best regards,
HMW
 
Old 10-06-2015, 02:51 AM   #3
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 514

Rep: Reputation: 48
By default, fonts in linux mint are located in /usr/share/fonts. I'm not sure if it was just a mistake or if that's where you actually installed the new fonts, but normally it should have been /usr/share/fonts/truetype. Also by default fonts have 755 and are owned by root:root. So that means that every user on the system can use the fonts - that's the default behaviour.

So what do you want to do exactly? Do you want to actually restrict the access of some users to certain fonts or do you want the fonts to be accessible by anyone?

Did you specify the font location when you ran fc-cache?
 
Old 10-06-2015, 04:22 AM   #4
chris319
Member
 
Registered: Jun 2003
Distribution: Linux Mint
Posts: 103

Original Poster
Rep: Reputation: 16
Thanks for the replies.

I have imported several fonts from my Windows HD and had to change the permissions for Linux.

In the gui you simply set the group to "root" and other users will be able to see them. If there were more accounts on this machine than me and root, I would want them all to be able to see the fonts. Now I have Times Roman (Arial they can keep). I am a big fan of legacy typefaces.

I ran

sudo fc-cache -fv

and it seems to find everything OK. The fonts show up in the font viewer, etc.

Last edited by chris319; 10-06-2015 at 04:27 AM.
 
Old 10-06-2015, 07:24 AM   #5
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 514

Rep: Reputation: 48
Quote:
Originally Posted by chris319 View Post
Thanks for the replies.

I have imported several fonts from my Windows HD and had to change the permissions for Linux.

In the gui you simply set the group to "root" and other users will be able to see them. If there were more accounts on this machine than me and root, I would want them all to be able to see the fonts. Now I have Times Roman (Arial they can keep). I am a big fan of legacy typefaces.

I ran

sudo fc-cache -fv

and it seems to find everything OK. The fonts show up in the font viewer, etc.
I doubt that setting the group to root allows other users to see them. In my opinion, it's the permissions that you give to others. As I was saying, by default the permissions are 755 with root as owner and group. So normally if you place them under /usr/share/fonts and try chown -R /usr/share/fonts/truetype and chmod -R 755 /usr/share/fonts/truetype and then run fc-cache, it should be fine - that is if you don't want to reboot instead of fc-cache.
 
Old 10-06-2015, 12:43 PM   #6
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
On my system, the fonts folders are owned by root, with read-only access for others. I expect Mint is the same. Anything put in them (using sudo in your case) will inherit those permissions, which is exactly what you need. You didn't need to touch the group setting.
 
Old 10-06-2015, 01:30 PM   #7
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 514

Rep: Reputation: 48
Quote:
Originally Posted by DavidMcCann View Post
On my system, the fonts folders are owned by root, with read-only access for others. I expect Mint is the same. Anything put in them (using sudo in your case) will inherit those permissions, which is exactly what you need. You didn't need to touch the group setting.
Yes, you're right. So indeed, no need for chown or chmod. Just place them there.
 
Old 10-07-2015, 11:16 AM   #8
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
You can also put fonts for a specific user in $HOME/.fonts which saves using su/sudo and works fine for a single-user computer.
 
Old 10-07-2015, 12:50 PM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Just a small nit - I'm not sure the licence for Windows includes allowing the fonts to be used under a Linux distribution.
 
Old 10-07-2015, 03:02 PM   #10
chris319
Member
 
Registered: Jun 2003
Distribution: Linux Mint
Posts: 103

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jpollard View Post
Just a small nit - I'm not sure the licence for Windows includes allowing the fonts to be used under a Linux distribution.
It's a moot issue if the fonts were obtained from a third party.
 
Old 10-07-2015, 05:17 PM   #11
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by chris319 View Post
It's a moot issue if the fonts were obtained from a third party.
Microsoft wouldn't think so.

The fonts were reported to come from a Microsoft system. And those do come with truetype fonts... or at least did when I knew of them.

Now if the fonts came from someone else then they wouldn't have come from a Microsoft system.

That was why I said "small nit".
 
Old 10-08-2015, 03:49 AM   #12
vincix
Member
 
Registered: Feb 2011
Distribution: Centos 6.7, 7
Posts: 514

Rep: Reputation: 48
Not trying to contradict anyone, but I'm trying to imagine the funny scenario where some people (don't know who regulates this stuff, anyway) came into your company and looked for unlicensed fonts on your linux system!
 
Old 10-08-2015, 06:54 AM   #13
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by vincix View Post
Not trying to contradict anyone, but I'm trying to imagine the funny scenario where some people (don't know who regulates this stuff, anyway) came into your company and looked for unlicensed fonts on your linux system!
Both Microsoft and the BSA have been known to disrupt companies with "license validation" searches. In the past, both have also called a Linux system "unlicensed" and improper.

The only sure way to prevent them is to be able to say "no Microsoft here".

https://www.microsoft.com/typography/faq/faq11.htm

Last edited by jpollard; 10-08-2015 at 06:57 AM.
 
Old 10-09-2015, 08:02 AM   #14
chris319
Member
 
Registered: Jun 2003
Distribution: Linux Mint
Posts: 103

Original Poster
Rep: Reputation: 16
I'm looking at the fonts directly from a Windows 7 installation and see the following copyright information for various fonts:

Arial, Times New Roman, Courier New, Impact: The Monotype Corporation

Georgia, Trebuchet MS, Tahoma, Tahoma, Calibri, Comic Sans MS: Microsoft

Lucida Console: Bigelow & Holmes

Quote:
Most of the fonts supplied with Microsoft products have been licensed from leading type foundries. In most cases Microsoft does not have the right to sublicense them.

Last edited by chris319; 10-09-2015 at 08:54 AM.
 
Old 10-09-2015, 08:52 AM   #15
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,478

Rep: Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020Reputation: 1020
Do you have a /etc/fonts directory that contains ./ ../ conf.avail/ conf.d/ fonts.conf fonts.dtd?

If so, you should create a file, local.conf, in that directory of the form:
Code:
cat local.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
	<dir>/usr/local/share/fonts/Adobe</dir>
	<dir>/usr/local/share/fonts/MSfonts</dir>
	<dir>/usr/local/share/fonts/myfonts</dir>
	<dir>/usr/local/share/fonts/Interstate</dir>
</fontconfig>
where the fonts you have added should be in separate directories as shown (and should also be in /usr/local/share/fonts rather than in your system directories -- keeps things neater).

In each of your font directories; e.g., /usr/local/share/fonts/MSfonts, you need to execute two commands:
Code:
su -     <become root>
mkfontscale
then
Code:
mkfontdir
From the manual page for mkfontdir:
Quote:
For each directory argument, mkfontdir reads all of the font files in the directory
searching for properties named "FONT", or (failing that) the name of the file
stripped of its suffix. These are converted to lower case and used as font names,
and, along with the name of the font file, are written out to the file "fonts.dir"
in the directory. The X server and font server use "fonts.dir" to find font files.

The kinds of font files read by mkfontdir depend on configuration parameters, but
typically include PCF (suffix ".pcf"), SNF (suffix ".snf") and BDF (suffix ".bdf").
If a font exists in multiple formats, mkfontdir will first choose PCF, then SNF and
finally BDF.

The first line of fonts.dir gives the number of fonts in the file. The remaining
lines list the fonts themselves, one per line, in two fields. First is the name of
the font file, followed by a space and the name of the font.
In my case, those font directories contain collections of fonts (MSfonts, for example, contains TTF files, Adobe contains the Adobe Type Library, and so on). You you don't really want to mix fonts of different types in the same directory -- won't hurt, but won't help either, keep 'em the same type).

Doing the above will make all fonts available to all applications for all users without any fooling around. The directories and files are owned by root and group root.

To make them available, you need to execute (once) as root
Code:
su -
/usr/bin/fc-cache -f
You do not need to do that again because there should be in your boot sequence that command; what it does is update X font indexes. You do it manually one time after you've done the above just to see if it's working.

Now all this depends on the existence of /etc/fonts -- if you don't have that, you're stuck with the really old fashioned way, sorry.

If you copy MS fonts to your Linux system, well, that's up to you.

Hope this helps some.

Last edited by tronayne; 10-09-2015 at 12:56 PM. Reason: Had the "mkfont" utility order reversed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
light glowing around Desktop Text in Menus, Window title font, application font, etc. 1sweetwater! Linux - Desktop 19 08-30-2014 02:43 PM
Default font does not display in applications, e.g. vlc. Shell, e.g. bash shows font jkharris SUSE / openSUSE 0 09-10-2012 11:18 AM
[SOLVED] How to change the default font-family and font-size under kde 4.8.4? kite Slackware 3 07-07-2012 12:55 PM
LXer: Oxygen Font, The New KDE Desktop Font Family, Available For Testing LXer Syndicated Linux News 0 01-06-2012 09:12 PM
Properly setting font permissions? aevangelica Linux - Newbie 3 03-23-2006 07:06 PM


All times are GMT -5. The time now is 01:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration