We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8522
    • 145 Posts
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    Snippet name: String2png
    Description: Generate image from string with any .ttf or .otf font
    Version: 1.0 Alpha
    Date: November 16, 2008
    Licencing:
    GNU General Public License (GPL) (http://www.gnu.org/copyleft/gpl.html)
    Authors:
    Enrique Erne (http://mild.ch)
    Based on WriteWord 0.24
    Example:
    [[String2png? &file=`media/RadisSans-medium.otf` &text=`Hello World!` &text_size=`36` &text_color=`#0000ff` &letter_spacing=`3` &word_spacing=`10` &format=`png` &transparent=`TRUE` &tpl=`yourChunk`]]
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Features:

    • letter-spacing and word-spacing
    • real alpha transparency
    • automatic width, height and baseline adjustment

    Compared to WriteWord 0.24:

    • drops support for angle
    • real alpha transparency

    Known Bugs:

    • negative letter-spacing and alpha transparency cuts letter edges

    Not yet tested with modx revolution.

    I am still uncertain about the naming. Should the arguments be as close as possible to the WriteWord snippet. Should there be a compatibility mode?

    Please note is a pre-release, any feedback appreciated.
      • 21610
      • 360 Posts
      Cool.
      letter-spacing and word-spacing - this is not enough.
      You can use negative values?
        Разработка сайтов на MODx
        • 8522
        • 145 Posts
        hi a.tuzhilkin

        what exactly is not good enough?

        yes you can use negative values but, as you can read in my previous post, there is a bug in combination with transparency and negative letter-spacing.

        i currently use it with negative spacing and without transparency, that is working fine.

        i forgot to mention i use it with german ä ü ö. i had to include some function to make it work correctly with utf-8

        please try smiley