We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22289
    • 41 Posts
    hmm... I’m getting the

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: imagettfbbox() [function.imagettfbbox]: Could not find/open font
    Error type/ Nr.: Warning - 2
    File: /httpdocs/manager/includes/document.parser.class.inc.php(705) : eval()’d code
    Line: 208

    Parser timing
    MySQL: 0.0024 s s (3 Requests)
    PHP: 0.0711 s s
    Total: 0.0736 s s

    with this:

    [[gtext? &font=`caslon.ttf` &fontsize=`10` &color=`#ffffff` &bgcolor=`#000000` &text=`My Text`]]

    I know my ttf is in the assets/fonts directory, backtics are being used, the file name is all lowercase in both instances... Does anyone have any idea what I could be doing wrong? I’ve read all of this thread as well as Text2PNG...

    also- I’m testing it live on the server (/var/www/vhosts/mysite/httpdocs/), so i don’t think there are any blank spaces causing issues. Text2PNG also generates an error...
      • 22289
      • 41 Posts
      Other possibilities I’ve eliminated:

      I’ve, to the best of my understanding, replaced all paths in the snippets to be full paths: "var/www/vhosts/mysite/httpdocs/assets" , and checked to make sure that FreeType Support is enabled, which it is on my phpinfo page. Then I switched it back when that did not solve the issue.

      I still think this has something to do with the base path, although I cannot figure out what. MaxiGallery, another snippet which I presume uses GD to make *it’s* jpegs, functions properly, yet both seem to use "config[’base_path’]"...
        • 22289
        • 41 Posts
        So it was my base path- I replaced all instances of:

        "config[’base_path’]."

        with

        "/var/www/vhosts/mysite/httpdocs/

        The gtext seems to sort of not be messing up now, although it has yet to actually quite work... but I have renewed confidence.
          • 22289
          • 41 Posts
          Actually- this is not a fix- it causes the snippet to not work at all- anything I put in the path is fine, as long as it isn’t
          "config[’base_path’]."
            • 7923
            • 4,213 Posts
            Quote from: ooghe at Oct 24, 2006, 03:07 PM

            ...I know my ttf is in the assets/fonts directory...
            Isn’t it supposed to be in assets/files/fonts?


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 22289
              • 41 Posts
              d’oh!

              thanks.
                • 8790
                • 526 Posts
                Back to the foundation : (maybe I should psot this as a new topic ?)

                I could see this snippet, based on class ATextImage could deal with Font size, color, and position..

                but
                is there any way to add Italic ou Bold or underline support ?

                Thank you

                  Schtroumpf Grognon - Grouchy Smurf
                  ---------------------------------
                  Faites pas attention.. - Don't pay attention
                  http://www.dzi-neo.net
                  • 11206
                  • 73 Posts
                  Hello there,

                  i am trying to use gtext so that it generates a series of images that will be used in a menu - so that i can use a non system (web) font for the menu.

                  I am using code from the snippet ListSiteMap to generate the list of pagetitles needed in the heirachy, and am calling gtext from in the loop, for some reason this doesn’t work - i get no errors, just a blank page.

                  any ideas why this could be? - is it because there are too many calls to gtext? (only 7 items in the menu).

                  any ideas?
                    • 7923
                    • 4,213 Posts
                    If you are using 0.9.5, parse errors are in the system event log, see that from the manager for possible info..


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."