Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-07-12 00:06:04

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Anti-aliased headline images

I’ve written a plugin which generates anti-aliased headline images to your textpattern site. It uses PostScript Type 1 fonts and GD. I haven’t tried it very much besides on my own site, but it works very well for me.

Get it here, and see it in action as well

Offline

#2 2005-07-12 10:04:58

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Anti-aliased headline images

The zem_ir plugin doesn’t do that (on any string) already ?

Offline

#3 2005-07-12 16:40:57

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Re: Anti-aliased headline images

Well, this plugin does it on any string as well. And it’s alot easier to use in my opinion. Didn’t even get zem_ir to work, that’s why i wrote my own. Use it if you feel like it, or else don’t. Nice to have a choice.

Offline

#4 2005-07-12 17:08:53

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Anti-aliased headline images

stefan can you explain how this is different – i mean if in any way from sem_ir i haven’t used that yet, or sifr, but how does this differ – cleaner code, faster?

cheers

Offline

#5 2005-07-12 17:38:28

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Re: Anti-aliased headline images

Well, zem_ir is pretty huge, has support for css files and alot more. This is way smaller at least. Haven’t got zem_ir to work on my site, so that’s why i decided to write my own. It’s probably a bit faster at least, because it’s slimmer.

Offline

#6 2005-07-12 17:39:39

sekhu
Member
Registered: 2005-05-12
Posts: 428
Website

Re: Anti-aliased headline images

thanks for explaining -i’ll takea look at as it may come in handy.

thanks

Offline

#7 2005-07-12 19:49:13

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Anti-aliased headline images

I am getting this error message:

<blockquote><pre>Fatal error: Call to undefined function ImagePsLoadFont()
in /home/…/pub/textpattern/lib/txplib_misc.php(379) :
eval()’d code on line 23</pre></blockquote>

Is there any setting regarding PHP which could the affect availablity of ImagePsLoadFont (My ISP is running PHP 5.0.4), or some other thing to obey?

Last edited by wet (2005-07-12 19:49:55)

Offline

#8 2005-07-12 19:52:06

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Re: Anti-aliased headline images

That’s probably because your ISP don’t have GD. Check that with <?php phpinfo(); ?> in a seperate .php-file.

Offline

#9 2005-07-12 20:15:14

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Anti-aliased headline images

Sorry, I am no PHP programmer, so I was only able to produce the very basic diagnostics, such as phpinfo() which prints this:

gd

GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with TTF library
FreeType Version 1.3
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
JIS-mapped Japanese Font Support enabled

Will that suffice?

Last edited by wet (2005-07-12 20:17:32)

Offline

#10 2005-07-12 20:17:27

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Re: Anti-aliased headline images

From what I see that should be enough. Strange that it doesn’t work then… Anyone else who might know why?

Offline

#11 2005-07-12 20:48:34

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Anti-aliased headline images

I’ve modified your code to read:
<blockquote>
<pre>

function ste_imgheadline($atts, $str) { if(!function_exists(“ImagePsLoad”)) return “<p><em>Error: Server does not support PHP image generation</em></p>”;

$font = $atts[“font”];

</pre>
</blockquote>

And that message is printed.

So obviously my ISP somehow removed graphic libraries in a way which would not be spelled out by phpinfo(); As a matter or fact, I have terminated my trials of zem_ir weeks ago because it also didn’t work at all and ran forever. Could be a common cause.

Would it be specific enough to ask my ISP if that gd library is installed in it’s entirety, or could I ask some tighter questions?

Last edited by wet (2005-07-12 20:49:05)

Offline

#12 2005-07-12 21:36:53

stefan
Archived Plugin Author
Registered: 2005-03-31
Posts: 12

Re: Anti-aliased headline images

The function you want to check for existance is ImagePsLoadFont, not ImagePsLoad.

Ask if the GD-library is installed and has support for Free Type fonts, maybe.
I found this in the php-manual about imagepsloadfont:
Note: This function is only available if PHP is compiled using —with-t1lib[=DIR].

Offline

Board footer

Powered by FluxBB