Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2005-10-10 07:00:45

dkruitbosch
New Member
Registered: 2004-12-17
Posts: 9

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Solved
I had to install the font with the mandrake 2005 font tools in Mandrake ControlCenter and than copy the ttf file to my webroot. So it works now.

—————————

Hi,

I’ve just upgraded my linux box to apache 2.0.53 and php 4.3.10 with gd 2.0.33. I’ve 2 installations of txp running:
4.0.1 with zem_ir 0.5 and 1.0rc1 with zem_ir 0.5.

Both installations give the same error when trying to create header with zem_ir:
Error: The server could not create this heading image.

with info=1 the output looks like this:
array(15) { [“text”]=> string(4) “test” [“font_file”]=> string(18) “/var/www/hndwr.ttf” [“font_size”]=> int(24) [“angle”]=> int(0) [“color”]=> string(7) “#AFB9C2” [“backgroundcolor”]=> string(7) “#ffffff” [“cache_folder”]=> string(24) “/var/www/html/images/zir” [“aa”]=> int(1) [“trans”]=> int(1) [“depth”]=> int(8) [“ft”]=> int(0) [“cache”]=> int(1) [“method”]=> string(5) “phark” [“align”]=> string(4) “left” [“pad”]=> array(4) { [0]=> string(1) “0” [1]=> string(1) “0” [2]=> string(1) “0” [3]=> string(1) “0” }
}
doc_root setting /var/www/html does match the server setting ‘/var/www/html’
cache folder /var/www/html/images/zir is a directory
cache folder /var/www/html/images/zir is writable
font file /var/www/hndwr.ttf is a file
font file /var/www/hndwr.ttf is readable
freetype 2 is supported
freetype 1 is supported

So to me everything seems to be just fine. Can anyone help me with this?

BTW: It used to work fine on 1.0rc1/zem_ir 0.5 and php 4.3.8/gd 2.0.27

Thanks,

Danny

Last edited by dkruitbosch (2005-10-10 08:38:16)

Offline

#134 2005-10-24 15:26:25

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Font compatability

Error: The server could not create this heading image.
I’ve found compatability with typefaces and this plugin to be pretty hit and miss. Most of my Mac typefaces wont work. Not sure why.

My Solution?
Use a font converter utility to convert typefaces to windows trutype before uploading to the server. This seems to work in most all cases.

Continued Challenges
  1. Sidebar Headers still display with space on the left rather than left aligned.
  2. Is there any way to make this plug work on all headers of a particular variety without explicily wrapping them in a tag? eg. all h3s?
  3. Is there any way to adjust Leading (line-spacing)?

Last edited by mrdale (2005-10-24 15:30:09)

Offline

#135 2005-10-25 04:52:31

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] zem_image_replace, version 2

The method “img” outputs invalid (x)html, i.e:
<img src="/path/to/image.png" alt="Second Post" title="Second Post">Second Post</img>

Just lettin’ ya know. :)

Offline

#136 2005-12-08 09:04:56

Jick
Member
Registered: 2004-11-27
Posts: 14

Re: [plugin] [ORPHAN] zem_image_replace, version 2

> mary wrote:
> The method “img” outputs invalid (x)html, i.e:
> <img src="/path/to/image.png" alt="Second Post" title="Second Post">Second Post</img>

Has this been fixed yet? I’m trying to use the img method and it’s outputting that invalid code so it’s causing me all sorts of hassles. Can someone suggest a temporary fix possibly?

I’m not sure exactly what all is going on but I am pretty sure the problem has something to do with the tag() function. He seems to be referencing that function when it comes time to build the output code in the plugin. I don’t see that function within the plugin code itself so I must assume that the tag() function is a built-in function of Textpattern. I’m not sure exactly where that function resides in the Textpattern files so I can’t really say how the function works. Since I don’t know how the function works I can’t tell if the error is with the tag() function or the plugin.

I can’t imagine it would be that hard to fix either way. I’ll do some searching through the Textpattern files for the tag() function and post my findings tomorrow if nobody has come up with a solution by then. If nobody posts I may end up coming up with my own solution. I’ll post that if all else fails and I figure it out.

Thanks to anyone who can help.

Offline

#137 2005-12-08 09:42:38

Jick
Member
Registered: 2004-11-27
Posts: 14

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Nevermind! I figured it out. It was easier then I thought it was gonna be. I simply added this to the plugin:

<code>function zem_ir_tag($content,$tag,$atts=’‘)
{ if($tag == ‘img’) { return ($content) ? ‘<’.$tag.$atts.’ />’ : ‘’; } else { return ($content) ? ‘<’.$tag.$atts.’>’.$content.’</’.$tag.’>’ : ‘’; }
}</code>

Then I changed all references to the tag() function to zem_ir_tag(). Boom! There you have it. Works perfectly.

Edit: Code didn’t show up right. Hopefully it’s displaying right now…

Last edited by Jick (2005-12-08 09:47:59)

Offline

#138 2005-12-08 14:03:11

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: [plugin] [ORPHAN] zem_image_replace, version 2

> mrdale wrote:

I’ve found compatability with typefaces and this plugin to be pretty hit and miss. Most of my Mac typefaces wont work. Not sure why.

It should never work simply because “classic” Mac TrueType fonts are not .ttf file and the plugin requires .ttf files (I think I ever answered to your question once 2 pages back). ;-)

Use a font converter utility to convert typefaces to windows trutype before uploading to the server. This seems to work in most all cases.

It should work in any case

Sidebar Headers still display with space on the left rather than left aligned.

It’s a graphic problem due to the design of the font itself (a glyph in a font has a kerning and spacing that can’t be reproduced as an image) a negative left margin should be a solution.

Is there any way to make this plug work on all headers of a particular variety without explicily wrapping them in a tag? eg. all h3s?

no but you can define a zem_ir group in a form loaded in every page to make the tag lighter.


Nico

Offline

#139 2005-12-08 14:04:16

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Jick, Can you please post the modified version as a whole? That’d be extremly cool!


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#140 2005-12-08 14:19:44

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [plugin] [ORPHAN] zem_image_replace, version 2

The plugin accepts otf too.

Offline

#141 2005-12-08 21:13:11

Jick
Member
Registered: 2004-11-27
Posts: 14

Re: [plugin] [ORPHAN] zem_image_replace, version 2

> creativesplash wrote:
> Jick, Can you please post the modified version as a whole? That’d be extremly cool!

Umm… well I don’t think files can be posted on this forum and I don’t dare post all that code directly seeing as it might screw it up so I’ll just link you to a text file copy of it on my server.

Here it is…

Offline

#142 2005-12-11 17:18:38

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

Hey Jick! Thank you so much for putting up the file! It works very well!


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#143 2005-12-12 03:23:01

Jick
Member
Registered: 2004-11-27
Posts: 14

Re: [plugin] [ORPHAN] zem_image_replace, version 2

No problem. ;) I just hope that it can be adapted (in some form) into the actual plugin someday. It’s really quite an easy fix so it shouldn’t take much work at all to add it in. I doubt zem will fix it in exactly that manner but my method takes care of the problem just fine until he updates his plugin.

Offline

#144 2006-03-13 12:58:25

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: [plugin] [ORPHAN] zem_image_replace, version 2

I managed to hack the code of this great plugin to make it works.

Originally, the url for the image produced was wrong. The image was created and cached, but img url had an excedding “/” in the url. I don’t know why, maybe some setting of mine.

Anyway, I modified the $url creation in the zem_ir function:

Before it was:

$url = $pfr . $cachedir . "/" . $data;

I changed this to:

if ($pfr != "/") {$url = $pfr . $cachedir . "/" . $data;} else {$url = $cachedir . "/" . $data;}

And it seems to work properly.

No idea if this may help someone else or if it is a bug, but that is.

Bye

Z-

Offline

Board footer

Powered by FluxBB