If I define a tag in Signwriter that doesn't already exist in standard html or php or whatnot, will Signwriter still recognize and support it?

CommentFileSizeAuthor
#8 9da47f1106c8d44e8ec45bca03431af2.gif276 bytessilurius

Comments

wrunt’s picture

When used as a filter, Signwriter uses regular expressions to match tags and text. So if you define a regular expression in your signwriter profile that matches your custom tag, then it will work.

I'll have some documentation up in the next few hours which will hopefully explain this a bit better.

silurius’s picture

That would be wonderful, looking forward to it. The obvious use case in this scenario, is wanting to retain the option of utilizing all "normal" tags and use Signwriter for special cases.

wrunt’s picture

I just tried out your idea, and it works. Try the following:

In your signwriter profile, set the pattern to: /<signwriter>.*?<\/signwriter>/

Then save the profile and enable it as a filter under input formats. Within a node you can now type <signwriter>some fancy text</signwriter>, and it should replace 'some fancy text' with some fancy text :)

wrunt’s picture

Status: Active » Fixed

I've added the above example in the profile editing page, and written some documentation too.

silurius’s picture

Thanks for the suggestion and for ammending the documentation. (Fantastic documentation, by the way. Most modules lack good docs).

I think I may be overlooking something. I actually tried the above suggestion in a basic profile but I got bad output. I'm using wingding and placed it in the root of my files dir. What might I be missing?

silurius’s picture

Should have included this: also created a special font dir and placed the ttf file into it and specified my full system path, e.g. /home/MYUSER/MYSITE.COM/...path.../fonts/wingding.ttf

wrunt’s picture

What was your bad output? If it doesn't find the right font then you should get a drupal error message saying so. Did you get that message? If not then it's finding the font ok, and the problem lies elsewhere.

When your font was in the root of your drupal files directory you should have set the font path in your profile to either /path/to/drupal/files/wingding.ttf or just wingding.

Actually, before you do anything, try downloading the latest version. I changed some of the font path stuff yesterday, although I'm pretty sure the files directory was searched in the old version.

Other things you could try:

  • Make sure your profile is enabled as a filter in the input format you're using.
  • Clear your drupal cache (truncate table cache). I've often had problems with drupal caching filters when it wasn't supposed to.
  • Check whether the directory 'signwriter-cache' is being created in your drupal dir, and whether it contains any images
  • Have a look at the watchdog log (the main admin page) and see if it has any relevant error messages.
silurius’s picture

StatusFileSize
new276 bytes

Attaching a screenshot of what gets rendered. I think it's actually locating the font file; I'm sure I've missed something. (I had just upgraded to your latest release).

wrunt’s picture

eek...

Ok, maybe try with a different font file. Those squares usually turn up when a font doesn't contain the character you want. If it still doesn't work in a different font then maybe it's something to do with the version of GD or truetype in your php install, or maybe I should add an option to use imagefttext instead of imagettftext.

Anonymous’s picture

Status: Fixed » Closed (fixed)