Solved

How do I fix: Error: Font 'Arial Bold' with encoding 'winansi': Font file (AFM, PFM, TTF, OTF etc.) or host font not found

Posted on 2009-05-04
6
2,127 Views
Last Modified: 2012-05-06
I keep getting this error when I load my program into linux (Ubuntu 8):
Error: Font 'Arial Bold' with encoding 'winansi': Font file (AFM, PFM, TTF, OTF etc.) or host font not found

I need to know:
1. What the path is that pdflib is looking in for these files.
2. Where I can get these files.
3. Anything else that resolves this issue.

Thanks.
0
Comment
Question by:rae_rae
  • 4
  • 2
6 Comments
 
LVL 11

Expert Comment

by:jausions
ID: 24298846
You'll need to specify the full path to the font file(s). The font file also needs to be in a folder accessible to PHP (open_basedir setting comes to mind.) So you may need to copy the font file to a sub-folder of your PHP application/site, verify access permissions and so on...

You should be able to download some of those fonts from the Internet, or install some font-related packages.
0
 
LVL 3

Author Comment

by:rae_rae
ID: 24299551
I pretty much knew all that already. I need to know:
What the path is (how to establish this) and where I can get the files (from what site). I can then install them, of course.
0
 
LVL 11

Assisted Solution

by:jausions
jausions earned 500 total points
ID: 24299729
Check: /etc/fonts/fonts.conf
/usr/share/fonts
/usr/local/share/fonts
/home/<username>/.fonts (where <username> is your user name).

In Synaptic search for "font" or "ttf" or "true type", etc...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Author Comment

by:rae_rae
ID: 24300291
Thanks. I'll look into this when I get back into work.
0
 
LVL 3

Author Comment

by:rae_rae
ID: 24310069
When viming /etc/fonts/fonts.conf I get this:
<dir>/usr/share/fonts</dir>
<dir>/usr/share/XLL/fonts</dir><dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>

Uder the Font directory list directive section.
Why does linux have so many font directories!? lol wth?

Anyway,
The fonts are all found under /usr/share/fonts/truetype/msttcorefonts/
Arial_Bold.ttf
Arial.ttf

My error: "'Arial Bold' with encoding 'winansi': Font file (AFM, PFM, TTF, OTF etc.) or host font not found" doesn't get fixed if I change my directive
from $bold_font = $pdf->load_font('Arial Bold', 'winansi', '');
to $bold_font = $pdf->load_font('Arial_Bold', 'winansi', '');

Neither does it correct if I change it
from $bold_font = $pdf->load_font('Arial Bold', 'winansi', '');
to $bold_font = $pdf->load_font('Arial', 'winansi', '');

This still is happening...and I still do not know why.
0
 
LVL 3

Accepted Solution

by:
rae_rae earned 0 total points
ID: 24310205
I figured it out. The fonts needed to be copied to the SearchPath directive location in the pdf set_parameter function.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now