Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to set default fonts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
equaeghe
Guru
Guru


Joined: 22 Feb 2005
Posts: 466

PostPosted: Wed Apr 25, 2018 9:25 pm    Post subject: How to set default fonts Reply with quote

I have a problem with a certain pdf. Its text is not shown in Okular probably because of a font issue. Currently, as a Helvetica replacement, "Liberation Sans Regular" is used. I want to use another font instead (such as Nimbus). How do I go about that?

Liberation is a dependency of LibreOffice, so I can't just uninstall it.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Apr 26, 2018 12:50 am    Post subject: Reply with quote

equaeghe ...

you would use a font substitution 'alias' in ~/.fonts.config ... but it's probably just a case of fixing this particular pdf. Try the following (requires app-text/ghostscript-gpl):

Code:
% gs -o filename-repaired.pdf -dPDFSETTINGS=/prepress -sDEVICE=pdfwrite filename.pdf

If that produces a more readable output then it is a font subsitution issue. If not, you might examine the pdf for what fonts are used (and so expected to be on the system, or the author embeded within the document).

Code:
% pdffonts filename.pdf

HTH & best ... khay
Back to top
View user's profile Send private message
equaeghe
Guru
Guru


Joined: 22 Feb 2005
Posts: 466

PostPosted: Thu Apr 26, 2018 6:57 am    Post subject: Reply with quote

khayyam wrote:
you would use a font substitution 'alias' in ~/.fonts.config

I'll try that later. Pointers for this welcome.
khayyam wrote:
but it's probably just a case of fixing this particular pdf. Try the following (requires app-text/ghostscript-gpl):

Code:
% gs -o filename-repaired.pdf -dPDFSETTINGS=/prepress -sDEVICE=pdfwrite filename.pdf

Ok, I tried this and got
Code:
GPL Ghostscript 9.21 (2017-03-16)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 6.
Page 1
Can't find (or can't open) font file /usr/share/ghostscript/9.21/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/9.21/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Querying operating system for font files...
Can't find (or can't open) font file /usr/share/ghostscript/9.21/Resource/Font/NimbusSanL-Regu.
Can't find (or can't open) font file NimbusSanL-Regu.
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... 4992420 3554912 9407116 7257921 3 done.
Page 2
Page 3
Page 4
Page 5
Page 6

So it seems there is a naming problem somewhere:
Code:
> locate NimbusSan
/usr/share/ghostscript/9.21/Resource/Font/NimbusSans-Bold                                                                                                 
/usr/share/ghostscript/9.21/Resource/Font/NimbusSans-BoldOblique                                                                                         
/usr/share/ghostscript/9.21/Resource/Font/NimbusSans-Oblique                                                                                             
/usr/share/ghostscript/9.21/Resource/Font/NimbusSans-Regular                                                                                             
/usr/share/ghostscript/9.21/Resource/Font/NimbusSansNarrow-BdOblique                                                                                     
/usr/share/ghostscript/9.21/Resource/Font/NimbusSansNarrow-Bold                                                                                           
/usr/share/ghostscript/9.21/Resource/Font/NimbusSansNarrow-Oblique                                                                                       
/usr/share/ghostscript/9.21/Resource/Font/NimbusSansNarrow-Regular                                                                                       
/usr/share/texmf-dist/tex/latex/nimbus15/OT1NimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/OT2NimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/T1NimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/T2ANimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/T2BNimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/T2CNimbusSans.fd
/usr/share/texmf-dist/tex/latex/nimbus15/TS1NimbusSans.fd
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu Apr 26, 2018 8:25 am    Post subject: Reply with quote

khayyam wrote:
you would use a font substitution 'alias' in ~/.fonts.config

equaeghe wrote:
I'll try that later. Pointers for this welcome.

equaeghe ... it's unnecessary in this case, as Nimbus exists. I'm not sure what's happening, did you look at the output of 'pdffonts'?

equaeghe wrote:
Code:
Loading NimbusSanL-Regu font from /usr/share/fonts/urw-fonts/n019003l.pfb... 4992420 3554912 9407116 7257921 3 done.
Page 2
Page 3
Page 4
Page 5
Page 6

So it seems there is a naming problem somewhere:

Actually, no, the font is found, Nimbus Sans L is provided by urw-fonts (and is not named 'nimbus' on the filesystem, but n019003l.pfb). Did you attempt to view the output from gs?

best ... khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum