Announce: Sgss Library
I've been working hard to complete the successor project of Fig. Sgss Library is a part of this project for providing over 200 general-purpose classes to handle font, graphics and related data. Nearly 80% of its development has been completed at this time.
See matsudashota.com/slapi for the API documentation currently available.
I'll announce again when the downloadable files available.

Abstract

This is a PHP script package which provides you with a convenient graphics environment accessible via url.

Such data management programs as Blog or CMS are spreading these days, we can thereby manage its data, appearance and structure separately. Is it really true? Some images become dirty when you change the background color of your website, and you will have to make them again. PHP Font Image Generator 2 removes the troublesome task.

Been a successor to PHP Font Image Generator, this is completely different. Command-like interface in HTTP GET method, object-oriented code, and the pluggable class must be very useful.

This consists of the following 4 files: PHP Abstract Drawing Toolkit (package.adt.php), PHP Graphics (package.graphics.php), PHP Get Method Command-like Interface (package.gmi.php), PHP Font Image Generator (package.fig.php), and file.drawtext2.php.

See the following pages for further detail.

URL からアクセスできる便利なグラフィック環境を提供する PHP のスクリプト・パッケージです。

Blog や CMS などのデータ管理プログラムによって外観と構造を別々に管理できるようになってきました。けれど、画像の中にはウェブサイトの背景色を変更すると使えなくなるものもあって、また綿々と作り直したりしなければならない。そんな面倒を PHP Font Image Generator 2 は解決してくれます。

位置づけとしては PHP Font Image Generator の後継ですが、全く別物になっています。HTTP GET メソッド上のコマンド入力インターフェイスとオブジェクト指向のコード、プラグイン可能なクラスなどによって、さらに使いやすくなっています。

PHP Font Image Generator 2 は 4 つのファイルを含んでます:PHP Abstract Drawing Toolkit (package.adt.php)、PHP Graphics (package.graphics.php)、PHP Get Method Command-like Interface (package.gmi.php)、PHP Font Image Generator (package.fig.php)、そして file.drawtext2.php で、普通はこれを変更するかこれの代替ファイルを作ることになります。

詳しくは以降のページを参照ください。

Demonstration

There is an excellent front-end interface by Jeff Orlando (Thanks!): http://interactimage.com/.

Jeff Orlando さんによる素晴らしいフロントエンド・インターフェイスがあります(ありがとう!): http://interactimage.com/

Main features

  • Send drawing command via HTTP GET method
  • Pluggable interface class
  • 7 horizontal alignments and 3 vertical alignments
  • Some useful drawing functions
  • Mutiline text
  • Mutisampling text antialias
  • Java like graphics classes
  • HTTP GET メソッド上での描画コマンドの送信
  • プラグイン可能なクラス
  • 7 つの水平方向の、3 つの垂直方向の文字整列
  • いくつかの便利な描画関数
  • 複数行にわたる文字の描画
  • マルチ・サンプリング・アンチエイリアス
  • Java に似た描画クラス

Requirements

  • PHP over 4 with FreeType library and GD library installed
  • Your own True Type font file
  • FreeType ライブラリと GD ライブラリがインストールされた PHP バージョン 4 以上
  • True Type フォントファイル

This is experimental and I assume no responsibility for any probrem resulting from the use of this.

これは実験的なもので、使用によって生じるいかなる損害も作者は責任を負いません。

Download

Change History

  • 2007-6-14
    • Fixed an alignment bug when text is not in a box.
    • ボックス指定されていないテキスト揃えのバグを修正
  • 2006-12-16
    • Fixed a bug in measuring height of text drawing area.
    • テキストボックスの高さの算出バグを修正
  • 2006-6-20
    • Supports image file exporting.
    • Fixed some problems.
    • 画像ファイルの書き出しのサポート
    • いくつかの不具合を修正
  • 2006-4-30
    • First Release.
    • 公開

Your script is great!

I am having trouble in making it work in my development server, but achieved to do it in my local PC and it's great!

Keep up this great work!

Thanks!

2006-10-31 01:49:16 JST
cafurcio

Wonderful work!

I'm not able to display text image ...shape and others works well.
My page load a bit and than no image is visible.
I've tried also with debug but not error is show and all seams right.

this is the code used for test:
<img src="file.drawtext2.php?exec=size 50,50;autoresize both;color 100,200,0;fill;color 255,255,255;font '/font/myfont.ttf',10,10;string 'autoresize both',10,10;" alt="" />

can you help me?
thanks!
Francesco

2006-12-15 17:33:17 JST
francesco

Thank you for using Fig2.

There are many possible reasons that text image won't display.
Please test the following items:
- Make sure the font works with imagettftext function.
- Try change the font file path for relative to the file "file.drawtext2.php".
- Change "error_reporting" configuration in your php.ini to "E_ALL", and check if the script dumps any error.

2006-12-16 23:35:34 JST
Matsuda Shota

Hello Shota, Having lots of fun with Fig2. Now Adding DHTML layers and AJAX request interface to allow creation of interesting composite scenes of multiple Fig2 images.

AJAX and fig2 play well together. Makes fig2 image pop onto the screen without page refresh.

2006-12-24 16:35:48 JST
Jeff Orlando

Hello! This works great, just what I needed for creating dynamic images with text. I have one question, I would like to add the ability to let users outline the text. I was going to try to add padding around each individual letter, is that possible? or is padding just for the entire image?

2007-01-17 00:18:28 JST
Noah Street

Hello Noah,
Sorry, Fig2 cannot add padding around each glyph (tracking). I'm now developping next version and that will do it.
Thanks.

2007-01-17 10:38:32 JST
Matsuda Shota

This is truly terrific! Wonderful, wonderful stuff. We are going to use this to allow users to preview font choices for vehicle graphics.

Question: Would you have any tips as to how this could be modifed to allow text on a curved path or possibly show text slanted (left or right) similar to italics?

Again, really great work! We're very grateful.

2007-02-02 13:44:07 JST
Rick Beddoe

Hello Rick, thanks for your comment.

Answer: No, Fig2 can't do it.

Regarding text on a curved path, the problem is it will be too complex to define a curved path. A bezier curve, for example, needs four points so that we have to write such code as "bezier:2,5,34,45,56,36,43,23;". I can't imagine it will look like. I must at least prepare a interactive front-end program.
Ok, I will implement some slanted text options in the next release.

Thank you.

2007-02-06 05:37:33 JST
Matsuda Shota

Thank you Shota.

For an example of what we'd like to be able to do, look at this: http://www.boatus.com/boatgraphics/

Note, however, that curved text is not shown correctly. Also note there are three fixed arcs in this example. We would probably only use one and attempt to show the text correctly (radially).

Rick

2007-02-08 14:11:23 JST
Rick Beddoe

great utility!!! I'm having trouble getting the vertical alignment to work properly. My image is 200px high, and when I call drawString I pass in a height of 200, but aligning the text vertically does not work. Is there a trick that I'm missing?

2007-02-25 17:35:04 JST
JD Hendrickson

Hi!
Fig2 is a very cool tool, many thanks! bu I've a few questions for you ;)
Is exist a simple way (or just a way) to have bold and non bold text togehter? in the exec mode? and to have a transparent background in this mode bgtrans is not available :(

thanks again

2007-03-09 01:38:43 JST
raoul

Hello
Fig2 is very COOL.
What license is it using? because I want to use these function
* 7 horizontal alignments and 3 vertical alignments
* Mutiline text
* Mutisampling text antialias
In one of my open source project, Imarty, it will convert instructions (XML files) into images

2007-03-14 07:55:45 JST
Mgccl

I love this utility, it's very elegantly put together.

I wanted to ask if there was any automatic way to rotate the text such that it displays vertically -- Not the individual letters, the horizontal axis itself just as if I'd generated the image normally and then rotated it (which is actually what I plan to do if there is nothing I can add to the exec parameter in this package to get the desired effect).

Again great work and thanks a lot!

neil

2007-03-23 02:30:38 JST
neil Casey

> JD Hendrickson
Hello,
If you are calling the drawString function directly, please use drawBoxedString function instead.

> raoul
Currently no, there is no simple way to draw texts with different style together. I will someway implement it, but unfortunately Fig2 is not well ordered internally, and I have to recreate all the code for the next version that will take long time, sorry.

> Mgccl
Thanks for your interest. Fig2 is under the Creative Commons Licence (http://creativecommons.org/licenses/by-sa/2.1/jp/deed.en).

> neil Casey
All right, I will update Fig2 with "rotate" parameter or the such as soon as I can.

2007-03-23 18:58:22 JST
Matsuda Shota

Greet Utility!
I'am using it now for a couple of months with great joy!
But after the move to an other host it's not working anymore :(. In the beginning there was an problem with FreeType Support, it was not installed, but since yesterday they have.

I'm getting the following error :
[30-Mar-2007 11:36:33] PHP Fatal error: Call to undefined function: imagettftext() in ...../public_html/texttodrawing/package.adt.php on line 168

I'am using PHP Version 4.4.6 and Register_globals has the value off is that maybe the problem.

Any idea what the problem can be?

Martijn

2007-03-30 19:59:50 JST
Martijn

I love this package! It's great to see a new font generation tool; this is by far the best I've seen. As a small suggestion, I didn't see a way to turn off the automatic header generation; I would like to generate images in the background and save them to the server without having to display them to the browser. I will perhaps recode this myself but just wanted to provide the thought and say thank you!

2007-04-06 02:47:49 JST
Scott

This is an awesome script! I love it!
I am using this to generate a book preview with an image background.
I noticed that when the text is displayed against an image background, the text outline is not smooth and has very visible jagged edges. Is there a way to avoid or fix this problem?

2007-05-26 14:31:31 JST
Carol

Hello Matsuda:

This is a wonderful library and I got it work at the very beginning upon installation of it on my shared hosting.
But today when I tried to open the previously worked url http://[mydomain].com/fontgenerator/file.drawtext2.php?text='PHPFontImageGenerator2'&font='font/Arctic.ttf'&size=20&color=0x000000&bgcolor=0xffffffit then it threw following error.
----
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your requests.
----
I also checked Apache error log and found this error message "Premature end of script headers: php5.cgi".
I talked to Shared hosting provider and they simply said that they can't help me in this 3rd party application. I am still trying to solve it and since it is shared hosting so I do not have permission to do anything with php5.cgi . Do you have any clue what could trigger this error. As earlier this was working fine. I have even set chmod 777 to fontgenerator folder recursively to check whether this is a permission problem or not. But still no help.

One more thing I found that one file named core got created automatically in fonegenerator folder when I run this url and it has data in binary format (not readable). Not sure is it created by your application or by something else.

I am feeling really very helpless and have a great hope from you for assistance to solve this issue.

My Phpinfo is
PHP Version 5.2.2
System Linux culligan 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686
Build Date May 10 2007 22:20:24
Configure Command './configure' '--prefix=/usr/local/php5' '--enable-fastcgi' '--with-mysql=/usr' '--enable-calendar' '--enable-force-cgi-redirect' '--with-config-file-path=/etc/php5/cgi' '--enable-trans-sid' '--with-gd' '--with-xml' '--with-xsl' '--with-ttf=/usr' '--with-freetype-dir=/usr' '--enable-exif' '--with-xslt' '--with-xslt-sablot=/usr' '--with-dom-xslt=/usr' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-pdo-mysql' '--enable-ftp' '--with-curl=/usr' '--with-pspell=/usr' '--enable-mbstring' '--with-mcrypt' '--with-mysqli' '--with-openssl=/usr' '--with-gettext'
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5/cgi
Loaded Configuration File /etc/php5/cgi/php.ini


THANK YOU IN ADVANCE.

2007-06-02 15:39:53 JST
Jai

I was trying to fix issue, but still after spending whole sleepless last night, I could determine where the error is happening.
So far my investigation concluded this (please see below lines of package.gmi.php)

In package.gmi.php
==================

Line#207-14:
// add slash before ";" in such quoted value as "...", '...' or {...}.
$lines = preg_replace_callback(
'/(?arguments[$i] = preg_replace_callback(
'/(?arguments[$i]
);
====================================


I found error "Internal Server Error" and in error log-"Premature end of script headers: php5.cgi " is happening either of

Possibility1. The first argument, i.e. pattern , passed in function preg_replace_callback. If I remove these three lines 210, 391 and 405 [i.e.

'(?<!\\\)\"(?:\\\\"|[^"])*(?:(?<!\\\)\")|'.] . Then fontimage does not get generated. But atleast I do not get "Internal server error".

OR

Possibility2. If in line #213, I just hardcode the value of

($exp = size {width},{height}; autoresize both; type {type},{palette},{color:{bgcolor}}; padding {padding}; color {color:{bgcolor}}; fill; color

{color:{color},{alpha}}; antialias {antialias}; font {font:{font},{size},{leading}}; string {text};)

to

$exp = "abcdefghijklmnopqrstuvwxyz";


and do the same thing for line #394 and #408, then also fontimage does not get generated. But atleast I do not get "Internal server error".


Since I was trying to first find why there is internal server error so I did not care about image generation. So probably if the Internal server error gets

fixed then I think everything will work fine.


I admit I am weak in regular expression so even after spending many hours I could not solve the issue.
Also my hosting company told that they updated the php to Version 5.2.2. And I dont have control over the settings of PHP in shared hosting so I could not

dive deep.

My url for font image generation is http://[mydomain].com/fontgenerator/file.drawtext2.php?text='PHPFontImageGenerator2'&font='font/Arctic.ttf'&size=20&color=0x000000&bgcolor=0xffffff

I also tried to search whether it could be some error in phpt but no definite answer, however I am sharing some links with you...

http://bugs.php.net/bug.php?id=25754

http://forum.dreamhosters.com/programming/65677-PHP-problems-with-new-Dreamhost-account.htm

But none of these links seems a real answer for the problem.

As usual, my shared hosting company, dreamhost.com has not been helpful and simply said they cant help in third party app :((

I would highly appreciate your help as this application is going to be a part of one my important project. I look forward for your favorable response as you are the only one who can help me out.

Thanks.
Jai

2007-06-03 19:12:25 JST
Jai

Matsuda, I experience the same problem as Jai with my PHP 5.2.2 installation. The script worked great on prior versions. Do you have any solutions?

Thanks for a great app!

/M

2007-06-10 04:53:00 JST
Martin

Since I could not solve the issue in PHP 5.2.2 so I got it downgraded. However I am now having a new issue where alignment=center or any other alignment does not work if autoresize=both
I have these two URLs
file.drawtext2.php?text='PHP Font Image Generator 2' &font='font/MyriadBold.ttf' &size=20 &acolor=0x000000 &bgcolor=0xffffff&align=right&autoresize=both&width=200&height=300
OR
file.drawtext2.php?text='PHP Font Image Generator 2' &font='font/MyriadBold.ttf' &size=20 &color=0x000000 &bgcolor=0xffffff&align=right&autoresize=both

In earlier case I am passing width and height and as per the documentation if I pass autoresize=both then it will ignore width and height but it does not ignore height and width rather it takes that width and height and alignment=right works fine

But in second case, where I am not passing width and height, then autoresize works fine but alignment doesnot work.

Matsuda: Can you tell me is this expected behaviour? or am I doing something wrong? My aim is to get alignment works with autoresize=both (I do not need width and height to be passed)

Thank you for your help.

2007-06-14 23:07:28 JST
Jai

Any possible news of the coming next release?
I can hardly wait!!!

Thanks for this amazing script!

2007-06-19 17:42:12 JST
Ran Baron

I just realized that the upgrade to 5.22 breaks this script from working. Did anyone file a way around it?

2007-06-20 19:03:25 JST
Ran Baron

Hi,
I have the same problem as Francesco.
If I testing it local, it works (PHP 5.2.1, GD-Lib & Freetype activated), but if I testing it on my webspace it doesn't work (PHP 5.2.0-8+etch4, GD-Lib & Freetype activated).
What can I do?

2007-07-09 09:02:08 JST
Niko

This is awesome! I just can't get it to output with a transparent background. I tried adding bgtrans=1 and it doesn't work. Do I need a certain version of gd or some other library that's part of PHP? I'm running PHP 5.2.1 and gd verison 2.0.28.

Thanks for a good script.

2007-07-09 16:07:13 JST
Trevor

Does any one have a simple code that will allow me to do the following: Have a text box where I can type some text and have radio boxes that allow me to select the font and when the submit button is clicked, the image with the text and specified font is created.

If anyone can help me with this, I would greatly appreciate it!

2007-07-28 03:33:32 JST
Jared

Hello Matsuda Shota,

first this piece of code safed me from a lot of work. Really, I already planned to cut every singe char out and safe it as a image file and then replace them with img-tags by javascript...
But now I'm having a lot of fun writing snippets for automatic text replacement by javascript and your script. I'm also working on a Joomla universal plugin.
I don't know your license, but your name will be held high up, and I'll release all my work under GNU/GPL.

But the fun has an end when it comes to this error on my second hosting provider:
Internal Server Error
Premature end of script headers: file.drawtext2.php

Server:
Apache / 2.0.55 (Debian)
PHP / 4.4.2-1

Mail me if you need additional information for bug tracking. I'd really like to solve this issue, but I need some help from your side.

Best regards,

Lukas

2007-08-08 05:08:07 JST
Lukas Rieder

I upgraded PHP to php 5.2.3 and now my the Fig2 script doesn't generate images anymore.
it only creates a 1px image. the GD2 library works when i try a sample GD2 script.

What can i do to fix this bug? Or when will there be an update where this bug is fixed?

Best regards,

Eelco

2007-08-13 20:09:58 JST
Eelco Schreurs

Hi,
Nice..
Thanks for the script!
I'm have a little trouble with the font path. When I use the full path for the font it works fine.
Like $ffolder = 'C:\wamp\www\gdg3\letgdg\\' . $_GET['fcat'] . '\\'

Also when I place the fonts in a directory where I have to navigate up one directory such as ../../ it works fine too.

But if I use a relative path such as 'fonts/arial.ttf' it doesnt work.
I've tried it with ./ in front and still no dice.
Any ideas.
Thanks,
John

2007-08-15 10:47:20 JST
John

i get this error on php 5.2.3:

Strict Standards: Assigning the return value of new by reference is deprecated in /opt/www/schorss/web/www.rkvvm.nl/textgif/package.fig.php on line 550

Strict Standards: Assigning the return value of new by reference is deprecated in /opt/www/schorss/web/www.rkvvm.nl/textgif/package.adt.php on line 86

Strict Standards: Assigning the return value of new by reference is deprecated in /opt/www/schorss/web/www.rkvvm.nl/textgif/package.adt.php on line 97

Strict Standards: Declaration of FontImageGenerator::execute() should be compatible with that of GMIExecution::execute() in /opt/www/schorss/web/www.rkvvm.nl/textgif/package.fig.php on line 116

i will look further for a fix. but maybe this also is handy for further development.

2007-08-16 22:26:34 JST
eelco

Found a update bug fix from php.net:

Strict Standards: Assigning the return value of new by reference is deprecated errors in -->

rename: = & to = clone

Now only the last error: Strict Standards: Declaration of FontImageGenerator::execute() should be compatible with that of GMIExecution::execute()

I still don't know how to fix this one. Found this PHP bug:

http://bugs.php.net/bug.php?id=41461

2007-08-16 23:04:45 JST
eelco

I just love it when stuff just works! :)

Is there documentation more than the beginning of the script for the layout of the construction of the URL to pass it, and secondly, any pointers on using this on pages to generate data for display on, say, a wiki? Like say, the page title on each page for example.

I've got it working on the server just by sending URLs to it.

Here is an example of what works for me right now;

http://example.com/fig/file.drawtext2.php?exec=size%2050,50;autoresize%
20both;color%20255,255,255;fill;color%20000,255,000;font%20'A2Font.ttf',
20,20;string%20'texthere',20,20;

If I wanted to use that within php, I presume I'm going to do something different with delimiters so that I can use the page title or whatever variable I wish to have drawn, instead of "texthere", for starters. ...

2007-08-18 17:15:13 JST
tdiaz

I found the docs..

2AM computing is not necessarily always a good thing.

right up there on the left.. I didn't see the listing, only the modules, previously, for some dumb reason. I also mostly got it integrated with the wiki.
Good deal. Thanks.

2007-08-20 05:06:46 JST
tdiaz

I very much enjoyed visiting your website. I came looking for the PHP image generation script, but I couldnt leave the site without looking at every page. You have some very nice work! Again, I LOVE the website, it is beautiful!!

2007-09-26 17:14:25 JST
Daniel

I'm having this problem with the first letter of the text being cut off in the image. This only happens with italics (slanted) fonts.
I have tried setting the padding to 10 in my url but it "pads" the background of the text only.
Please see the image to see what I mean: http://geocities.com/hamid_afridi_2006/font_image/font_sample.gif

This is the code I used:
file.drawtext2.php?exec=size 50,50;padding 10;autoresize both;color 0xFF9900;fill;color 0x000000;font '/font/neversaydie.ttf',40,40;string 'Font Generator',10,10;

Please let me know if anyone can help, thanks!

2007-09-27 07:15:38 JST
Afridi

On that clipping of the font, if you put in   in there, as needed, you can actually pad the font.

I'd like to figure out how to use file.drawtext2.php the 'simple' way

http://apple2.info/index.php - I can't get transparent text to work using exec= and I can't get even this plain example from the other page to work at all;

much less, get bgtrans to work with it, all I get is a 1x1 .gif file.


Otherwise, I'm making extensive use of this and it's just way way cool. :)

2007-10-08 14:19:34 JST
tdiaz

The thing is that I am not able to put a space in before the first letter. After the first letter any I can put any amount of spaces anywhere and It will show it in the image as well.
Looking at my code below: I have typed "Font Generator". Before the word "Font" I have hit the space bar , in between "Font" and "Generator" I have hit the space bar twice.
So in the generated image, it will show the two spaces between "Font" and "Generator" but it will not show the space before "Font" (ie, the first letter).

file.drawtext2.php?exec=size 50,50;padding 10;autoresize both;color 0xFF9900;fill;color 0x000000;font '/font/neversaydie.ttf',40,40;string ' [SPACE BAR] Font[SPACE BAR][SPACE BAR]Generator',10,10;

2007-10-10 14:46:52 JST
Afridi

Could you please give a working example using bgtrans where the background is transparent so that I may see it actually work?

I have yet to ever get this to work in text mode, just exec mode.

All I get is 1x1 pixels, in php 4 or 5.

Thank you.

2007-10-22 06:14:53 JST
tdiaz

Has anybody got this to work with PHP 5.2.4 ? If so, can you inform of necessary modifications to the script?

2007-10-25 23:46:36 JST
Shift Control

I found when bgtrans=true and color of the text has been selected white then the created image will be completely transparent. As I guess white has been used to make image's background transparent. Does any one have this problem or I am alone?

Shota; Is this expected?

2007-10-27 22:09:12 JST
Jai

WOW your script is amazing! i'm not able to make rollover buttons.... can i have a look at your "file.HeaderItem.php" it would help me a lot to customize your script. Or is it the same as in the defaultscript? I don't know where to set the hover actions.

2007-11-10 22:18:59 JST
Daniel

I will be forced to upgrade my php version to the latest one by the end of the month, did anyone resolve the issues with latest versions of Php? I'd hate loosing this amazing class.

2007-11-27 02:07:43 JST
Ran Baron

I had the same problem with Internal Server Error on higher PHP version and different server (i moved my web, previous was working smoothly)... and i FIGURED OUT where's the problem! It's in imageFill(); function which gets a color value it cannot handle - it is package.graphics.php file line: ~1255. I've tried many workarounds but I seem to not understand the color creation process... so I'm stuck. I've tried to use imagecolorallocate but didnt get it to work... im still n00b in gd-related stuff so one would shurely fix this issue with a bit better knowledge. So pls pls helpo, cause this scripy is great!

2007-11-30 03:04:47 JST
Franc

Looks like eelco was making some progress...has anyone managed to get this working under 5.2.3?

2007-12-05 10:58:56 JST
Andrew P

Found a cure for 'Strict Standards: Declaration of FontImageGenerator::execute() should be compatible with that of GMIExecution::execute()'

In the file package.fig.php find the execute function inside the class FontImageGenerator
It needs to be passed an argument so that it's the same as the execute function in the GMIExecution class.

so the execute function in FontImageGenerator can be changed to this:
function execute($exp = "") {
etc.

follow eelco's solution for the pass by reference bugs, or set your php.ini to allow_call_time_pass_reference = On, and then it should work again. It's working for me with php5.2.5

and i can't finish without saying thanks for such an excellent script, it's so useful.

2007-12-07 02:57:51 JST
Richard Creek

hi, great script. really thanks.
How can i use fonts with letters with tilde, example: á, é. Because when i use this letters, this script dont write the letter
REUS

2007-12-07 17:00:07 JST
REUS

Hi!
Congrats for this super script.
Could you tell me how can I generate a transparent png? I have tried the "bgtrans" param, but without any result.

Thank you!

2008-01-25 03:18:46 JST
Levi

great work!

but im missing options for the line-height,
on my font, the lines are touching each other.
is there a solution?
i didnt found it in the reference.

penter

2008-02-28 00:54:35 JST
penter

I everybody :) Good script :) BUT TRANSPARENT PNG IS NOT WORKING. Is there any solution to resolve this problem. As I understood nobody knows how to do that in this discussion.

2008-03-20 14:56:01 JST
VAHAN SAHAKYAN

Hi dear Matsuda Shota :)
How can I resolve transparency problem. When I write bgtrans=true, nothing happens. Is Transparent PNG working normal ?

2008-03-25 18:56:14 JST
VAHAN SAHAKYAN

I couldn't get the tranparency to work in basic mode either, but I finally figured out how to do it in exec mode. I thought since everyone seems to be having some problems with this, I would try to comment.

Basically what I have surmised is that it doesn't really matter what the background color is (orange, green etc) but it will make that color, and that color only, transparent. So, since the script does such a nice job antialiasing the text to make it look smooth, you will have a 1-2 pixel transition from your font color to your image background color that will not disappear. So if you set your font color to blue and your transparent color to orange, then you will have a choppy 1-2 px edge of orange/blue transition pixels. I found that if I put a background image behind the font and match the color of the background roughly to the color that I set as transparent, the font output looks perfect and I can still use it in html layers.

Here is an example that I got to work:

The first and second 'color' references should be the same color and the color that would be your background image color. In this example it is white 255,255,255, but it shouldn't matter. The third color I have entered as black in hex (0x000000) but I think it could be RGB also.

Hope I didn't goof anyone up here!

2008-04-02 07:34:41 JST
JeffreyM

I have figured out the problem with transparent images. You **must** include a "pallete" attribute.

This is due to a couple of bugs in file.drawtext2.php - I couldn't think of a "clean" way to fix this, so for now I'm just offering up this workaround.

Here is an example URL with working transparency:

You can do transparency on PNG with type=png - and you could even increase the palette count if you want. I'll try working out the bugs in the next few days and see if i can make another post.

2008-04-08 12:21:49 JST
AronG

Hi guys,
I've got the same problem with internal server error. The script works under PHP 5.2.5, but not on PHP 5.2.3. The problem lies in:

- package.gmi.php
- function: execute
- call: create_function('$matches', 'return preg_replace(\'/([;])/\', "\\\\\\\$1", $matches[0]);'),

I don't have solution yet.

2008-05-20 18:11:03 JST
Rok Meglic

I can't work out how to get this script to work. All I get is a 1x1px image. The server is running php 5.2.5 and i have s script based on http://www.anyexample.com/programming/php/gd___freetype_text_label_generator.xml which works, but i want to use this script. can anyone help me get this script working

2008-05-30 09:09:50 JST
Chris
Toggle Comment Form