Menu

Fonts on OS X

Ken Davies
2012-03-16
2012-09-07
  • Ken Davies

    Ken Davies - 2012-03-16

    Hi All,

    I've just started using PHPlot and created my first graph. The only problem
    I'm having is using TTF on our OS X Server. No matter what I try, if I use TTF
    fonts (with or without paths, even copying a font to the PHPlot directory),
    the graph is not displayed unless I remove SetDefaultTTFont.

    Can anyone give me any clues?

    TIA

     
  • lbayuk

    lbayuk - 2012-03-16

    Hi... I don't have OS-X, so we are going to have to debug this together.

    Are you seeing an image with an error message? PHPlot should produce an image
    containing an error message (instead of a plot) if it is unable to find the
    font. But it sounds like you aren't even getting this.

    Do you have access to the web server error log? You are looking for an error
    message in the case where you get no output.

    I suspect something worse is wrong here, not just unable to find the font.
    Have you tried checking the PHP configuration, using a script with just "<?php
    phpinfo();" in it? Look for the gd extension section. You should see: FreeType
    Support: enabled, FreeType Linkage: with freetype.

    Based on what you find, we can try a simple GD+TrueType test and see what
    happens.

     
  • Ken Davies

    Ken Davies - 2012-03-23

    I've been doing a bit of digging on this and it looks like where OS X is
    configured and where it keeps various files and directories is different
    enough from a standard Unix setup that getting this stuff working is a major
    undertaking. I installed phplot on a Windows server and everything worked
    exactly as it should!

    Many thanks for responding and I already have a different query which I start
    a new thread for.

    PHPlot, by the way is excellent!

     
  • lbayuk

    lbayuk - 2012-03-23

    Thanks for following up. Maybe there will be another chance some day to get it
    working on OS-X. PHPlot already has a few tricks it uses (in the protected
    GetDefaultTTFont() function) that lets it find a font by default on a few
    systems (Windows, some Linux, Ubuntu-like Linux). It does bother me that it
    couldn't find the fonts in your current directory, though.

    I did find one issue, that I am including here for future reference because it
    might be relevant. There is a bug report opened against PHP, although it is
    actually a Freetype problem. The report says that they could not open TT font
    files if they were on a mounted CIFS (e.g. Samba) volume. This was due to a
    problem with 32-bit vs 64-bit inode numbers, and Freetype being built without
    64 bit file offsets (-D_FILE_OFFSET_BITS=64). There was a work-around for
    mount.cifs (noserverinfo option).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.