wordpressimage-replacementflir

Wordpress FLIR (Facelift Image Replacement) plugin clipping off end of text


I'm using the FLIR for Wordpress plugin (v0.8.9.2) with FancyFonts enabled. I'm running Wordpress 3.1. The problem I'm having is that it appears the plugin is cutting off a couple pixels off of the end of some of the text that it generates. It doesn't do it for all text, but where it happens, it happens consistently.

Here are some examples:

enter image description here

enter image description here

enter image description here

In my search for a solution, I've found a number of people with this issue, but never any solutions. Any ideas would be greatly appreciated. Thank you!


Solution

  • I know this was asked quite a while ago, but while researching the problem I came up with a solution. Every page I'd read on this was a bunch of people bickering about the source of the problem and reproducing it, but nobody provided a solution.

    This doesn't fix the problem at its source, but it works perfectly. Open generate.php

    Find:

    $FLIR['text']                   = html_entity_decode_utf8($FLIR['text_encoded']);
    

    Replace With:

    $FLIR['text']                   = html_entity_decode_utf8($FLIR['text_encoded']) . " ";
    

    All it does is force a space after every input string. The space is rendered along with the rest of the text, but is cut off (so you don't see it). This doesn't add the space to the actual HTML, so if it's rendered using a text-browser, rendered without FLIR, or accessed by a crawler (for SEO) the additional space will not show. It is only inserted into the PHP function which creates the image.

    After searching for about an hour, I thought it would be helpful for there to be at least one fix on Google.

    EDIT: This doesn't work for text with letter-spacing. I was about to give up and just not use letter spacing, but I found this this worked (again, not solving the problem at the source but fixing the visual issue in the same way). Open inc-flir.php

    Find:

        return rtrim($ret);
    

    Replace With:

        return $spacetxt . rtrim($ret) . $spacetxt;
    

    This inserts the same amount of space on either side of the image as are in-between each character. I added the spaces to both the left and right side so that the text will be mostly centered.

    EDIT AGAIN:

    Oh yeah! And don't forget clean both FLIR's cache and your browser's cache or you wont see the updates!