LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-25-2020, 05:17 AM   #1
gonthcarovd
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Rep: Reputation: Disabled
Question Can't use Century Schoolbook L font on Ubuntu 20.04 even though its .pfb file is shown by fc-list


Hello,

I'm running Ubuntu 20.04 as a VM on a MacOS host.

I require the Century Schoolbook L font (and likely others in the future). I checked that this font is present under the form of a .pfb file on my system:

Code:
$ fc-list | grep Century                            
/usr/share/fonts/type1/gsfonts/c059013l.pfb: Century Schoolbook L:style=Roman
/usr/share/fonts/type1/gsfonts/c059033l.pfb: Century Schoolbook L:style=Italic
/usr/share/fonts/type1/gsfonts/c059016l.pfb: Century Schoolbook L:style=Bold
/usr/share/fonts/type1/gsfonts/c059036l.pfb: Century Schoolbook L:style=Bold Italic

In addition the /usr/share/fonts/type1/gsfonts/ folder contains a .afm and a .pfm file for each .pfb file.
However, there is no match for this font in the font cache:

Code:
$ fc-match Century
DejaVuSans.ttf: "DejaVu Sans" "Book"
Here are the permissions of one of these files:

Code:
$ ls -l /usr/share/fonts/type1/gsfonts/c059013l.pfb
-rw-r--r-- 1 root root 106309 Okt 31  2017 /usr/share/fonts/type1/gsfonts/c059013l.pfb
I have tried rebuilding the cache multiple times to no avail with:

Code:
% fc-cache -v -r
and

Code:
% sudo fc-cache -v -r
I have read that this might be due to a permission issue. Therefore I tried copying the /usr/share/fonts folder to $HOME/.local/share/fonts and rebuilding the cache, with no success.

I did have success with installing Microsoft fonts by copying the relevant .ttf and .TTF files into /usr/share/fonts and rebuilding the cache with the above command.

Code:
$ ls msfonts                                                 
AndaleMo.TTF  AriBlk.TTF   couri.ttf     Georgiaz.TTF  Times.TTF     Verdanab.TTF
Arialbd.TTF   Comicbd.TTF  cour.ttf      Impact.TTF    Trebucbd.TTF  Verdanai.TTF
Arialbi.TTF   Comic.TTF    Georgiab.TTF  Timesbd.TTF   Trebucbi.TTF  Verdana.TTF
Ariali.TTF    courbd.ttf   Georgiai.TTF  Timesbi.TTF   Trebucit.TTF  Verdanaz.TTF
Arial.TTF     courbi.ttf   Georgia.TTF   Timesi.TTF    Trebuc.TTF    Webdings.TTF

For Microsoft fonts the cache can match the correct font for Arial:
Code:
fc-match Arial                                                
Arial.TTF: "Arial" "Regular"
This makes me wonder:
  • Can I only install fonts using .ttf or .TTF files?
  • If .pfb files (postscript fonts?) serve no purpose, why are they shown by fc-list?
  • How do I proceed?
 
Old 06-25-2020, 07:59 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,702

Rep: Reputation: Disabled
Quote:
Originally Posted by gonthcarovd View Post
Code:
$ fc-match Century
DejaVuSans.ttf: "DejaVu Sans" "Book"
Because Century doesn't match the font family:
Code:
$ fc-match "Century Schoolbook L"
c059013l.pfb: "Century Schoolbook L" "Roman"
$ fc-match :postscriptname=CenturySchL-Roma
c059013l.pfb: "Century Schoolbook L" "Roman"
$ fc-match "Century Schoolbook L":style=bold
c059016l.pfb: "Century Schoolbook L" "Bold"

Last edited by shruggy; 06-25-2020 at 08:27 AM.
 
Old 06-25-2020, 08:53 AM   #3
gonthcarovd
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
You are right, I mistakenly thought that the font name didn't have to be exact.
I get the same output as you for "Century Schoolbook L".

Nevertheless, the font is still unavailable in LibreOffice so I fear it's not quite available on my system yet.
(My real application involves fine tuning a Tesseract 4.0 OCR model whose training data requires this font.)
 
Old 06-25-2020, 10:33 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,702

Rep: Reputation: Disabled
Ah yes, see the LO bug #104701, particularly comments 4 and 6 there:
Quote:
Originally Posted by Adolfo Jayme
Support for old Type-1-format fonts has been dropped. Ensure the URW fonts you have installed are SFNT (TrueType or OpenType).
Quote:
Originally Posted by V Stuart Foote
the non Unicode Type 1 PS fonts have been completely dropped with ESC approval
It seems AbiWord, Calligra Words and GIMP still support them.

Alternatively, you may use the newer Unicode variants of these fonts from the package fonts-urw-base35. They're supported by LO. E.g.
Code:
$ fc-list :foundry=urw:style=roman
/usr/share/fonts/type1/gsfonts/c059013l.pfb: Century Schoolbook L:style=Roman
/usr/share/fonts/type1/urw-base35/C059-Roman.t1: C059:style=Roman
/usr/share/fonts/type1/urw-base35/P052-Roman.t1: P052:style=Roman
/usr/share/fonts/type1/gsfonts/p052003l.pfb: URW Palladio L:style=Roman
C059 is basically the same as Century Schoolbook L, and P052 is basically the same as URW Palladio L (compare the file names for Ghostscript fonts).

Last edited by shruggy; 06-25-2020 at 10:51 AM.
 
3 members found this post helpful.
Old 06-26-2020, 01:49 AM   #5
gonthcarovd
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
I downloaded the Century fonts from from this GitHub repo.

Now the Century Schoolbook is available in LO.

However, for my real application I still need the font "Century Schoolbook L Medium".

I tried downloading another set of Century fonts from wfonts. The font still isn't available.

Would you know where I could find this particular font?
 
Old 06-26-2020, 07:53 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,702

Rep: Reputation: Disabled
Sorry, but you've lost me here. Why are you trying to download the font with this exact name? As I said, you have a bug-for-bug clone of Century Schoolbook L in C059 from fonts-urw-base35. Besides, you have a reworked and enhanced version of it in TeX Gyre Schola from fonts-texgyre.

Just specify either of them in the --fontlist option to tesstrain.sh (and the appropriate location in --fonts_dir):
Code:
./tesstrain.sh --fonts_dir /usr/share/fonts --fontlist $(fc-list -f '%{?fullname{"%{fullname[1]}" }{}}' C059) ...
or
Code:
./tesstrain.sh --fonts_dir /usr/share/texmf/fonts --fontlist $(fc-list -f '"%{fullname[1]}" ' 'TeX Gyre Schola') ...
Alternatively, you can adjust the font list in src/training/language-specific.sh to your liking. E.g., to reflect the actual name of the font face you have installed:
Code:
sed -i '/Century Schoolbook L/s/Medium/Roman/' src/training/language-specific.sh

Last edited by shruggy; 06-26-2020 at 08:04 AM.
 
Old 06-29-2020, 01:05 AM   #7
gonthcarovd
LQ Newbie
 
Registered: Jun 2020
Posts: 4

Original Poster
Rep: Reputation: Disabled
I guess I wanted to download the font with the exact name because I didn't know how to configure Tesseract to use the clone font. Your comment explained it very clearly. I managed to create the desired training data. Thank you for your help! It really got me forward
 
  


Reply

Tags
fontconfig, tesseract


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
Does there remain even a small niche for telnet in the 21st century? jamtat Linux - Networking 6 09-05-2017 08:02 AM
libvorbis-1.2.0 refuses to compile - doesn't find ogg even though its there brokenpromises Linux - Software 2 01-04-2011 11:55 AM
Distorted sound as though its too loud, even at low volume. neocookie Linux - General 2 10-18-2007 03:24 PM
Can't access the samba server (RedHat9) frm WinXP though it's shown in network places rajibshovan Linux - Networking 11 01-08-2007 05:20 AM
Failed dependancy even though its there steveman2000 Linux - Newbie 2 10-23-2005 12:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:13 AM.

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
Open Source Consulting | Domain Registration