Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2004-08-13 22:28:22

Kaiser
Archived Plugin Author
From: Denver, CO
Registered: 2004-07-04
Posts: 27
Website

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

This is going to sound dumb, but did you activate the plugin?

I had the same problem, tried a bunch of stuff, and then realized I forgot to activate it. Sometimes it is the littlest thing.

Last edited by Kaiser (2004-08-13 22:32:23)

Offline

#14 2004-08-13 22:51:35

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

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

Yes, I did.
But it was a good suggestion :)
I think we’ve all been known to miss such obvious things when looking too deeply.

Thanks, but it must be something else.

I downloaded the plugin. Installed it. Activated it.
Made a folder called “fonts” in my public_html folder on my server.
I uploaded a font named Bradley___.TTF into the fonts folder.
I changed my code in my article form around the <code><txp:title /></code> tag as shown above.
Then I tried many adjustments and variations on the setup and code, to no avail.

I hope someone can help me out here.

Last edited by starzabove (2004-08-13 23:24:28)


90+ Textpattern installs and still going…

Offline

#15 2004-08-13 23:00:22

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

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

That’s a great idea, thanks a lot Zem.

I have a newbie question: is the GD2/ImageMagick tool is used for each new visitor on the page (each new parsing of the TXP page/article), or is it cached somehow ?

Another question: is it possible to create a default transparent (8bit, no alpha) background ? With an attribute to create alpha transparency (for the hardworker using MS filter to force IE to handle png alpha transparency) ?

Last edited by Jeremie (2004-08-13 23:02:33)

Offline

#16 2004-08-14 00:24:11

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

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

> If I leave the tag as given in the plugin text, if I use corinne’s revision as shown here, if I put in fontdir=”/” or fontdir=“http://mydomainname.com/”, with or without forward-slashes all over the place, making a “fonts” folder in the root directory, in the public_html directory, in the textpattern directory – nothing seems to work! I either get a blank page or I get the aforementioned error.

“fontdir” is used to specify the local server directory name, which can be quite different to the path you see in URLs.

Take a look at your doc_root setting in the Textpattern config. It will typically (though not always) look like this:

$txpcfg['doc_root'] = '/home/example/public_html';

By default, the plugin assumes the font will be in /home/example/ – your home directory, outside the publically-accessible doc_root. This is so you can safely use a commercial font without risk of someone downloading it.

If you’re using a setting like font="fonts/foo.ttf" (without a fontdir), the plugin looks for it in /home/example/fonts/foo.ttf.

If you’ve placed the font in public_html/fonts, you’ll need to use font="public_html/fonts/foo.ttf". Or alternatively, fontdir="public_html/fonts" font="foo.ttf".

For most users on a shared vhost plan, the simplest thing to do is:

1. Upload the font file to your home directory – not public_html, but the directory that contains public_html. This will usually be the directory you start in when you use FTP.

2. Use a tag like this:

<txp:zem_image_replace font="myfont.ttf" position="right"><txp:page_title /></txp:zem_image_replace>

Last edited by zem (2004-08-14 00:45:22)


Alex

Offline

#17 2004-08-14 00:34:55

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

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

> That’s a great idea, thanks a lot Zem.

Welcome.

> I have a newbie question: is the GD2/ImageMagick tool is used for each new visitor on the page (each new parsing of the TXP page/article), or is it cached somehow ?

It’s cached. The plugin generates it for the first page view only, and stores it in images/zir/.

> Another question: is it possible to create a default transparent (8bit, no alpha) background ? With an attribute to create alpha transparency (for the hardworker using MS filter to force IE to handle png alpha transparency) ?

I’m not quite sure what you’re asking. The current version always creates a transparent PNG. Next release will make that optional. Is that what you mean?


Alex

Offline

#18 2004-08-14 00:43:45

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

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

Zem,
Thanks for the explanation, that is one of the many things that I have tried, but that setup gives me a blank page. Not even just my page with the font missing error, but NOTHING on the page whatsoever.

Thanks with your help on this, I would REALLY like to figure this out.


90+ Textpattern installs and still going…

Offline

#19 2004-08-14 00:55:25

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

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

Starz,

A blank page usually indicates a syntax error of some kind – either an error in the plugin, or possibly some broken syntax in your <txp:...> tags (unclosed tags, missing quotes, etc). Without more information, my guess is as good as yours.

You could try editing publish.php and uncommenting the ERROR_REPORTING and ini_set lines near the top – that should at least let you see an error message.

If you can reproduce the blank page issue with a particular tag, please post an exact copy of the tag so I can find the cause and fix it.

It might also help if you posted:

- your doc_root setting
- the absolute path of your font file

You can send those to me via email if you’d prefer.


Alex

Offline

#20 2004-08-14 01:21:35

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

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

> zem wrote:
> It’s cached. The plugin generates it for the first page view only, and stores it in images/zir/.

Great.

>I’m not quite sure what you’re asking. The current version always creates a transparent PNG. Next release will make that optional. Is that what you mean?

I saw in your first post ??Background color, in #rrggbb format. Default is

Last edited by Jeremie (2004-08-14 01:22:05)

Offline

#21 2004-08-14 12:18:06

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

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

I’m guessing that it only supports .ttf fonts. Is there any possibility that .pfm or .otf fonts will be added or is it a limitation threw PHP that stops these lovely font formats?

Last edited by obeewan (2004-08-14 12:18:27)


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

#22 2004-08-14 19:44:49

ChrisJ
Member
From: Vienna, Austria
Registered: 2004-03-30
Posts: 54
Website

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

I had no problems with opentype .otf fonts.

But yes, only position=“right” works, and I don’t know how to use another image replacement trick that changes <span> tag with the image. <del>Example (static image) on my website as the header.</del>

css code for this technique:
<code>
.replace {position: relative; margin-left: 0.8em; padding: 0;
/* hide overflow: hidden from IE5/Mac */
/* \*/
overflow: hidden;
/* */
}
</code>
.replace span {display: block; position: absolute; top: 0; left: 0; z-index: 1; /* for Opera 5 and 6 */ }

#yourid, #yourid span {width: ...px; height: ...px; background-image: url(/path/to/image.gif);}

html example:
<h1 class="replace" id="yourid"><txp:page_title /><span>&nbsp;</span></h1>

Last edited by ChrisJ (2005-02-21 11:04:17)

Offline

#23 2004-08-15 00:18:45

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

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

Chris,

You can’t do exactly that, but you can achieve something similar. Try putting the CSS in your stylesheet, and using code like this:

<code>
<txp:zem_image_replace font=“fonts/myfont.ttf” class=“replace” ><span><txp:page_title /></span></txp:zem_image_replace>
</code>

It won’t supply the width and height attributes, so it may not work.


Alex

Offline

#24 2004-08-15 08:11:02

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

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

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:

<txp:zem_image_replace font=“myfont.ttf” info=1>test</txp:zem_image_replace>

..to see some useful information about paths and permissions.

Last edited by zem (2004-08-15 08:22:16)


Alex

Offline

Board footer

Powered by FluxBB