We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • This is an auto-generated support/comment thread for gtext.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Basically you can use any .ttf to create a graphical rendition of your text.

    It is 'load-reduced' and you can use it from within other snippets as well.
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
      • 2136
      • 134 Posts
      thank you very much for creating this plugin! i’m a noob, so apologies if the answers should be obvious:

      - can the one gtext snippet be used for multiple fonts, or should multiple snippets with different names be used?
      - do you have some specific examples of how to use this? my first attempt resulted in an error as i tried to put the following into a document’s content:

      the last few words in this sentence should be written [[gtext? &font=’CACPINAF.TTF’ &fontsize=’16’ & color=’#FFFFFF’ &bgcolor=’#000000’ & text=’in a cool font’]].

      i replaced arial.ttf with CACPINAF.TTF in the snippet as that’s the font i uploaded into assets/files/fonts.
        Sorry - not using ModX anymore 01/01/2007
      • Try backticks instead of single quotes around the argument’s values.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 2136
          • 134 Posts
          is this

          `

          a backtick?
            Sorry - not using ModX anymore 01/01/2007
          • Indeed it is, it shares a key with the tilde ( ~ ). Usually to the left of the 1 key, although on my iBook for some reason that key is § / ±, while the backtick/tilde key is to the left of the z.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 2136
              • 134 Posts
              i must be doing something silly - i put it into the content of a page (ie not in the template) and what showed up is

              /assets/images/gtext_cb61fa08baa0726f734a314c20225319.gif

              opening that image revealed it to be the text that was supposed to be displayed. here’s how i’m calling the text:

              [[gtext? &font=`BabelSans.ttf` &fontsize=`16` &color=`#aa3e00` &bgcolor=`#dbeaf0` &text=`Graphical Text Test`]]

              should that be in the source rather than the content?


              thank you.
                Sorry - not using ModX anymore 01/01/2007
              • I think you need to use the snippet as the value for the src attribute of an <img... tag.

                <img src="[[gtext? &font=`BabelSans.ttf` &fontsize=`16` &color=`#aa3e00` &bgcolor=`#dbeaf0` &text=`Graphical Text Test`]]" alt="" />
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 2136
                  • 134 Posts
                  ok - i will try that. thank you again!
                    Sorry - not using ModX anymore 01/01/2007
                    • 2136
                    • 134 Posts
                    a couple of questions:

                    1) right now, i put the code into the source of page content. is that the only way to do it? i tried putting it into the content itself, but it just spat out the code like it was text.
                    2) i assume having control over kerning is too much to ask for?


                    thanks.
                      Sorry - not using ModX anymore 01/01/2007
                      • 2136
                      • 134 Posts
                      is it not possible to use 2 instances on one page? i made 2nd graphic text which results in the following error:


                      Fatal error: Cannot redeclare class atextimage in /home/gatewayy/public_html/manager/includes/document.parser.class.inc.php(705) : eval()’d code on line 78
                        Sorry - not using ModX anymore 01/01/2007