I can get imagettf to work just fine EXCEPT with nearly all dingbat fonts, including zapfdingbats, webdings 1-3, and numerous others. A few dingbat fonts work OK, for some reason. All nondingbat fonts work OK.

Is there some switch someplace I need to throw??

    What exactly doesn't work about them? They work as expected for me.

      see example here:
      http://test-site.net/textreplace/test2.php

      This shows an image of the alphabet set in a font returned by some code I found and adapted.

      I uploaded the ttf fonts from my windows xp pc. The dingbat fonts that show as boxes display OK on my pc.

      The fonts are being found, as an error is displayed when that's the problem. Text is being written, as another error gets thrown if no text.

      So the problem is in the meat of the script, or maybe with GD or freetype? I need a clue.

      Here's user note from the PHP online manual (which is offline at the time I'm writing this...):

      wechsler at infinitepenguins dot net (13-May-2003 05:24)

      Some .ttf files open fine - no errors appear - but then print a small square glyph in place of each of the characters you've requested.
      This doesn't mean your code is wrong!
      Instead, it appears to be a property of specific .ttf files, as other .ttf files (eg, those supplied with OSX) work fine in exactly the same code.
      My guess is that the files that don't work lack UTF-8 mapping tables.

      That' the only reference I can find that resembles my situation.

        Okay, I found something really interesting... it works fine on PHP5, but not on PHP4. Or, perhaps it works fine on Windows, but not on FreeBSD.

        I uploaded my Wingdings 2 TTF file in hopes that it would work for you, knowing that they worked for me. Then, I uploaded my test file--and, low and behold, I get the same error as you.

        Works under PHP5 on Windows XP, doesn't work under PHP4.3.5 on FreeBSD.

        So, apparently you're not alone with this.

          I now suspect that it is something about the FONT rather than the script. I can download freeware dingbat fonts from free websites and the fonts display OK.

          What I need is for these fonts to display:
          zapf dingbats
          webdings 1,2,3

          I think that's it.

          If anyone can help me get those fonts going via imagettftext, I'd be very grateful.

            Here's my test. This is running on FreeBSD.

            Works perfectly on my Windows box.

            So, something changes there.

              Write a Reply...