Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2004-08-15 08:17:00

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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

Obeewan,

Version 0.3 might support additional font formats, including .otf and Type 1, if you have GD2/Freetype installed. Or it might not, I haven’t been able to confirm either way. Maybe someone can tell me.


Alex

Offline

#26 2004-08-15 16:22:43

starzabove
Member
Registered: 2004-04-13
Posts: 76

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

> zem wrote:

> Version 0.3 is available for download. Full docs > here.

> New in this version: > * Freetype support (which may or may not mean Opentype support) > * anti-aliasing (requires Freetype) > * “angle” attribute, for arbitrary text rotation > * “info” attribute which might help debugging > * “depth” attribute, with 8/24 bit support > * “trans” attribute to select image transparency > * more explicit error messages > Knock yourselves out. If the “angle” thing doesn’t start a new > > fad, I’ll be bitterly disappointed. > Those who are having trouble with permissions or font files > > should try something like this: <code> <txp:zem_image_replace font=“myfont.ttf” info=1>test</txp:zem_image_replace> </code> > ..to see some useful information about paths and permissions. > > > >

Since this might help someone that has not been able to get this type of function to work in any way, like me, with Zem’s great “info” attribute idea, this is what I just found out:
“freetype is not supported
GD is not supported”

Which is very weird since I run this server and GD is supported, and I have never come up with freetype not being supported and have even used embedded fonts, so just off the top of my head, would assume that to be an error.

I will research it on my server, but meanwhile do you, zem, or anyone else have a clue as to what I might do to further research or even fix this situation?

Thanks so much!

Last edited by starzabove (2004-08-15 16:24:39)


90+ Textpattern installs and still going…

Offline

#27 2004-08-15 18:29:12

starzabove
Member
Registered: 2004-04-13
Posts: 76

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

UPDATE
I did an apache rebuild, since there was a new version out anyhow.
It seems it was the freetype not enabled that it was tripping up on with this plug-in and before when I tried to use the ALA technique myself.
Kudos to zem for coming up with a great way of getting down to the root of the problem- if only all plug-ins/scripts could have such a great built-in diagnostic tool!

VERY cool on the angle attribute zem, I am using it at 7 degrees, if nothing else to pay homage to your great efforts.

Now, my regular text from my <code><txp:title /></code> tag is still showing up on top of this png image of the title. Any ideas on what to do about this?

Thanks again!


90+ Textpattern installs and still going…

Offline

#28 2004-08-15 18:50:19

starzabove
Member
Registered: 2004-04-13
Posts: 76

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

Oh my gosh- I think I actually have something to contribute!

I went into the plugin text, changed this:

margin: 0 0 0 -5000px;

to this:

margin: 0;

then put the position=

Last edited by starzabove (2004-08-15 18:50:53)


90+ Textpattern installs and still going…

Offline

#29 2004-08-15 22:40:15

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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

> margin: 0 0 0 -5000px;

> to this:

> margin: 0;

I think you’ll find this causes overwritten text in many browsers. The point of the ‘-5000px’ is to shift the text offscreen, so only the image is visible.

If you’re seeing overwritten text with the -5000px margin, it’s probably because of an interaction with some other CSS on the page. Could also be a browser incompatibility.

Can you post a URL that demonstrates the problem?


Alex

Offline

#30 2004-08-15 23:42:29

starzabove
Member
Registered: 2004-04-13
Posts: 76

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

I’ve tried in both IE6 and Firefox with the same results.
It shows the text, with the plug-in code change or not.

http://starzabove.com
I’ve messed with all sorts of CSS selectors and I don’t see what’s causing it to happen.

and even weirder is what it is doing here:
http://sternski.com

It’s clipping the images that it is generating?
I tried it on one other site, but had to return it to normal, and it’s doing the chopping off thing, too. After trying several adjustments, different fonts, etc. And all 3 sites are on the same server, and were checked in both IE6 and Firefox.

Thanks, again and again.

UPDATE-
I just tried it on still another site, and leaving the margin in there as
margin:0 0 0 -5000px;
does eliminate the text over-writing, but I’m still stuck with the right position.
I’m going to do some more CSS searching.
I did find another workaround, in CSS actually. I put this around the <code><txp:title /> tag
<span style=“font-size:2px;color:sameasbackgroundcolor;”><txp:title /></span></code>
I may have to go with such for now.

Last edited by starzabove (2004-08-15 23:51:53)


90+ Textpattern installs and still going…

Offline

#31 2004-08-16 01:17:56

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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

I have a solution for left alignment. Expect a new release soon.


Alex

Offline

#32 2004-08-16 22:25:33

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

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

The left alignment issue is because you do the -5000px to the left margin. If the attribute states for instance position="top left" the -5000px should be at the right margin and the text-align style should be set to right.

But I am guessing this is what you are working on for the new release.

Also, I have another issue. The typeface I use gets clipped at the bottom see my TXP development site for a “demo”.

Check the g in editing in the second article.

I tried setting the height attribute but then I realized that’s just for the CSS, not the image itself.

Also I might add that it’s a .pfm/.pfb font! So it works! Gotta celebrate this somehow hehehe .. The font attribute point to the .pfb file and I am not sure if the .pfm file is needed, ohwell ..

Last edited by obeewan (2004-08-16 22:30:31)


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

#33 2004-08-16 22:55:08

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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

Obeewan,

Regarding the ‘g’ issue: it could be that I’ve messed up the font baseline calculation, or it could be that Freetype reports it incorrectly or differently for .pfm fonts.

It’d help if you could collect some information for me. Edit the plugin (click on its name in the plugin list), and look for this line, about half way down:

<code>list($w, $h, $base_x, $base_y) = imagerotatedbbox($box, $angle);<code>

Add this just before that line:

<code>
print “<!—”;
var_dump($text, $box);
print “—>\n”;
</code>

Finally, temporarily add the attribute “cache=0” to your <txp:zem_image_replace> tag. Refresh the page, view the source, and you should see something like this:

<code>
<!—string(32) “A little editing of Textpattern”
array(8) { [0]=> int(-1) [1]=> int(1) [2]=> int(227) [3]=> int(1) [4]=> int(227) [5]=> int(-26) [6]=> int(-1) [7]=> int(-26)
}
—>

Post the results here, or send it to me via email.

Thanks.


Alex

Offline

#34 2004-08-16 23:09:38

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

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

It’s in your mailbox zem.

Also, the -5000px on the right alignment didn’t work properly as can see on my site. Creates a gigantic horisontal scrollbar since they think the element is thoose 5000px wide. Doh!

I was thinking to redo and make it -5000px top and vertical-align to top and the image to bottom left .. I’ll report my progress here.

—-

Edit:
Progressreport came fast. That idea I can scratch and flush down the toilet. Big fat no go there. Ohwell, I tried ;)

Last edited by obeewan (2004-08-16 23:12:55)


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

#35 2004-08-16 23:52:38

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

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

Which browser are you using? There’s no scrollbar in IE 6 or Mozilla.

I mistakenly left out one of the Radu attributes in the last version; perhaps the next release will fix it.


Alex

Offline

#36 2004-08-17 02:35:34

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

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

Just came to think of something. To use clip on the headlines so it clips what to display, anything else gets cut off.

Currently I am too tired to write an example but with the above URL I think you (read zem) will get the hang of it.


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

Board footer

Powered by FluxBB