Skip navigation

Adding fonts for PDF output

946 Views 23 Replies Latest reply: Jan 8, 2014 2:20 PM by Kurt Lang RSS
1 2 Previous Next
Dan Hinckley Level 1 Level 1 (0 points)
Currently Being Moderated
Mar 19, 2013 5:06 AM

I am running GNUplot scripts which produce PDF output files, using the pdflib installed via MacPorts.

 

"pdflib @7.0.5_1+universal (active)"

 

I've added a symbols font called MoonPhases.ttf to the fontbook.

 

The GNUplot Acqua terminal finds those fonts but the PDF lib does not. I have set an explicit "set fontpath "/Users/house/Library/Fonts/MoonPhases.ttf" with no luck.

 

GNUplot's "show fontpath" displays:

 

"system fontpath is "/System/Library/Fonts" "/Library/Fonts" "/Users/house/Library/Fonts"" so it does know where to look.

 

Can anyone offer advice about how to make that TTF font available to the PDFlib?

iMac, Mac OS X (10.6.8), iMac 24" 2.8 ghz 4 GB RAM
  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 19, 2013 6:15 AM (in response to Dan Hinckley)

    Hi Dan,

     

    Are you using Font Book? If so, the first time you tried to add the Moon Phases font (the damaged one), may have toasted FB's database, preventing the corrected font from showing up in all apps.

     

    You can try clearing Font Book's database and see if that helps.

     

    Restart your Mac and immediately hold down the Shift key when you hear the startup chime to boot into Safe Mode. Keep holding the Shift key until you see a progress bar towards the bottom of the screen. You can let go of the Shift key at that point.

     

    OS X asks you to log in (you will get this screen on a Safe Mode boot even if your Mac is set to automatically log in). Let the Mac finish booting to the desktop and then restart normally. This will clear Font Book's database and the cache files of the user account you logged into in Safe Mode.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 19, 2013 8:44 AM (in response to Dan Hinckley)

    Do you have that font only in the Fonts folder of your user account? Just making sure you haven't created a font conflict by putting a copy of the font in more than one active folder.

     

    Also, you note one of the paths as:

     

    /Users/house/Library/Fonts

     

    I presume "house" isn't actually the short name of your user account and you're just using that word as a place holder for these forums? Of course, it could be house, but I'm assuming you were referring to the picture of the house OS X shows for the currently logged in account.

     

    You might also want to try removing all font cache files. I'm not really expecting it to help, but it can't hurt to try.

     

    Close all running applications. From an administrator account, open the Terminal app and enter the following command. You can also copy/paste it from here into the Terminal window:

     

    sudo atsutil databases -remove

     

    Terminal will then ask for your admin password. As you type, it will not show anything, so be sure to enter it correctly.

     

    This removes all font cache files. Both for the system and the current user font cache files. After running the command, close Terminal and immediately restart your Mac.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 19, 2013 11:40 AM (in response to Dan Hinckley)

    Hmm. Just for the heck of it, I saved out the font again, only this time as PostScript OpenType. Click on the link above to download it. I gave the new .zip file the same name, but now contains both the .ttf you grabbed before, and the new .otf version.

     

    Make sure to disable the .ttf version before loading the .otf font.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 19, 2013 4:43 PM (in response to Dan Hinckley)

    Oops! Goofed. Yup, it's the same link as the one I embedded in the your other thread, not this one.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 20, 2013 6:20 AM (in response to Dan Hinckley)

    Can, or should, one keep both the .ttf and .otf versions enabled in FB?

    No, that would create a font conflict. The only difference between them is the file format they're written in. They have the same internal names, so can't be used at the same time.

    I fear I need somehow to tell PDFlib how to access them, or build it with them included but have had no luck so far on finding instructions for doing so.

    I don't get it, either. There's nothing wrong with the rebuilt font. It should work.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 20, 2013 7:35 AM (in response to Dan Hinckley)

    Hi Dan,

     

    I looked through the document a bit. It is indeed really involved. You almost need to be a programmer to understand some of the things you need to do to point it to the fonts you want to use. Much harder than it should be.

     

    Is what you're outputting too complex to just create the PDF out of OS X? For instance, if you're in TextEdit and use the Print command, you can go to the lower left of the print dialogue, click PDF and then Save as PDF.

     

    OS X's built in PDF creator really butchers images, but works fine for text.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 20, 2013 11:26 AM (in response to Dan Hinckley)

    GNUplot is a *nix command line graphing program

    Ah! So the PDF output has to also be through the Terminal. Hmm, one more try. Download the same .zip file of converted fonts. I added a Type 1 PS version to it.

  • Kurt Lang Level 7 Level 7 (31,495 points)
    Currently Being Moderated
    Mar 21, 2013 6:05 AM (in response to Dan Hinckley)

    having added that .pfa extension myself.

    That might work. This is all really weird. The manual states you can use any TrueType, OpenType or Type 1 PS font without modification, yet none of them have worked for you. A .pfa font is a UNIX/Linux version of a PS font (the binary outline portion).

     

    Download the .zip file one more time, I've added a UNIX .pfa version to it.

1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.