Go Premium for a chance to win a PS4. Enter to Win


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
Medium Priority
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.

Question by:rae_rae
  • 4
  • 2
LVL 11

Expert Comment

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.

Author Comment

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.
LVL 11

Assisted Solution

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

In Synaptic search for "font" or "ttf" or "true type", etc...
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 24300291
Thanks. I'll look into this when I get back into work.

Author Comment

ID: 24310069
When viming /etc/fonts/fonts.conf I get this:

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

The fonts are all found under /usr/share/fonts/truetype/msttcorefonts/

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.

Accepted Solution

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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

886 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