Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Zem,
On this page you have used a width attribute to get your image titles to make them all align to the left correctly like so:
<h2 style="margin: 0 0 0 -5000px; background: url('/images/zir/77f3711e4b5a5622a2894629f0e87c4b.png') no-repeat top right; height: 32px; width: 5418px; text-align: left;">txp:zem_image_replace version 0.3.</h2>
The width is the 5000px negative margin plus the width of the actual dynamically created image. How do you calculate the width of the image to add to the 5000px and output that?
Also I’m using Freetype and find the images are clipped height wise when using .otf fonts. Do you have a fix for this too?
Last edited by Case (2004-08-17 04:55:08)
Forget your dreams
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Another bug:
It does not support swedish characters (ex åäöÅÄÖ) aswell as some portugeese (ex ñ). This bug may come from that the FreeType lib does not support UTF-8, not totally sure.
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#39 2004-08-18 08:49:37
- starzabove
- Member
- Registered: 2004-04-13
- Posts: 76
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Anyone have any idea why it might be seriously chopping the images? Not just clipping corners, but most of the letters?
It’s happening on a couple of sites, and I’ve checked the CSS, and tried several other fonts, fonts that I am already using in other places, but I’m lost on this one.
Here is an example:
http://sternski.com
The top center title there should say “The Sterns”
The image that is made:
http://sternski.com/images/zir/ed133787b059d0dc5255ded7da43e1b5.png
Thanks!
Code on main index template page:
<code>
<div id=“head”>
<txp:zem_image_replace font=“XO.TTF” backgroundcolor=”#9a99ff” position=“center” class=“imrep” wraptag=“h3”>
The Sterns
</txp:zem_image_replace>
</div>
</code>
Corresponding CSS:
<code>
#head{margin:0;padding:0;}
.imrep{
color: #9a99ff;
font-size:0px;
text-decoration:none;
height:100px;}
</code>
Last edited by starzabove (2004-08-18 08:55:31)
90+ Textpattern installs and still going…
Offline
#40 2004-08-18 11:58:46
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Last release gets the baseline wrong for some fonts. Working on it.
Alex
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
I tried and tried but did not get the clip
CSS attribute to work, currently using FIR to get the text left-aligned as I want it to. Not optional for screenreaders but for now it will do.
I though have a new idea that might work. What if you add whitespace to the image according to how much alignment it uses. Say we use, -1000px on the left margin and want the background to “top left” align. Could we not just add 1000px to the left side of the created image? Since it would only be backgroundcolored (or even better, transparent) it would not take up that many bytes no?
Maybe not the best solution but might work.
Plugins:
ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#42 2004-08-19 09:01:19
- starzabove
- Member
- Registered: 2004-04-13
- Posts: 76
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Actually………… I figured out that it must be something else, zem, when I had tried fonts that were working fine on other sites with this same version.
Look at what works:
<code>
<div id=“head”>
<txp:zem_image_replace font=“XO.TTF” wraptag=“h3” backgroundcolor=”#9a99ff” fontsize=“36” class=“imrep” position=“center” angle=“4”>THE STERNS</txp:zem_image_replace>
</div>
</code>
compared to what didn’t:
<code>
<div id=“head”>
<txp:zem_image_replace font=“XO.TTF” backgroundcolor=”#9a99ff” position=“center” class=“imrep” wraptag=“h3”>
The Sterns
</txp:zem_image_replace>
</div>
</code>
And I added/removed the fontsize and angle to each, so that had no bearing – whether they were there or not.
So apparantly order matters for the attributes? I may have missed that, but thought I’d share with others just in case they did, or this was news.
Thanks again!
Last edited by starzabove (2004-08-19 09:02:54)
90+ Textpattern installs and still going…
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
With the default CSS algorythm positionning works fine with me. I’ve tested IE5.5, 6 and Mozilla. IE 5.01 is a little wrong, but that was predictable it can’t handle much CSS.
But, I can’t made the transparency to work. I’ve used <code><txp:zem_image_replace font=“merlinn.ttf” wraptag=“h1” color=”#FF7417” trans=“1” ></code> and the background is still white.
Example here : http://www.ludys.org/textpattern_g119/
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Jeremie,
You have to edit the plugin to get transparency to work. For some reason this has been commented out. Just remove the hash signs and it should work with trans=“1”
like so:
// set transparency if($transparent_background) ImageColorTransparent($image,$background_color) ;
Forget your dreams
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Thanks. It took my server a dozen attemp to handle it (don’t know why yet), but it made it.
Ouch… 8 bits transparency is really really ugly… I definitely need to find that MSIE hack to handle PNG’s alpha transparency.
Last edited by Jeremie (2004-08-19 10:02:50)
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
I tried this plugin, but always get an error: “The server couldn`t create this headerimage” as plain-text.
I`ve first tried the ALA-solution first, but got the same error, except that an image with the same error-message was produced.
I checked my PHP-version (4.3.3) and GD-Support (2.0.15 with support for all image-typs and freetype enabled) is enabled.
Any Ideas ??
“Remember the times when sex was safer than skydiving”
Offline
Re: [plugin] [ORPHAN] zem_image_replace, version 2
Install Zem’s error-handling plugin, and try the image-replace plugin with info=“1” as attribute. It will give a lot of datas about what is right and what is wrong, that could help you (or Zem if you email him with the details).
Offline
#48 2004-08-19 17:26:59
- starzabove
- Member
- Registered: 2004-04-13
- Posts: 76
Re: [plugin] [ORPHAN] zem_image_replace, version 2
control-o, I was getting that message on one page and I fought and fought with it until I realized I was looking at an entry that did not have any text – it was a blank <code><txp:title /></code>.
Not sure if that will help, but it was what fixed things for me – putting a title for that one entry.
90+ Textpattern installs and still going…
Offline