Wordpress FLIR(Facelift Image Replacement)插件剪切文本末尾

发布于 2024-10-22 01:39:59 字数 428 浏览 1 评论 0原文

我正在使用启用了 FancyFonts 的 FLIR for Wordpress 插件 (v0.8.9.2)。我正在运行 WordPress 3.1。我遇到的问题是,该插件似乎正在从它生成的一些文本的末尾切掉几个像素。它不会对所有文本执行此操作,但在发生的地方,它会一致地发生。

以下是一些示例:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在寻找解决方案时,我发现很多人遇到这个问题,但从来没有任何解决方案。任何想法将不胜感激。谢谢你!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

过期以后 2024-10-29 01:39:59

我知道很久以前就有人问过这个问题,但在研究这个问题时我想出了一个解决方案。我读到的每一页都是一群人在争论问题的根源并重现它,但没有人提供解决方案。

这并不能从根本上解决问题,但效果很好。打开generate.php

查找:

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

替换为:

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

它所做的只是在每个输入字符串后强制添加一个空格。该空间与文本的其余部分一起渲染,但被切断(因此您看不到它)。这不会将空间添加到实际的 HTML 中,因此如果使用文本浏览器呈现、不使用 FLIR 呈现或由爬网程序访问(用于 SEO),则不会显示额外的空间。它仅插入到创建图像的 PHP 函数中。

搜索了大约一个小时后,我认为谷歌上至少有一个修复程序会很有帮助。

编辑:这不适用于具有字母间距的文本。我正打算放弃,只是不使用字母间距,但我发现这有效(同样,没有从源头上解决问题,而是以相同的方式解决视觉问题)。打开 inc-flir.php

查找:

    return rtrim($ret);

替换为:

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

这会在图像两侧插入与中间相同的空间量每个字符。我在左侧和右侧都添加了空格,以便文本大部分居中。

再次编辑:

哦,是的!并且不要忘记清理 FLIR 的缓存和浏览器的缓存,否则您将看不到更新!

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!

忆离笙 2024-10-29 01:39:59

谢谢。我会使用 font-face 来解决这个问题,但是两个答案(在那些 php 上)都成功了。

问题出在稳定版本 1.2 上,然后我发现了 v2.0beta3 。顺便说一下,问题出在 Chrome 上...

哦...如果您使用 mode='wrap',您可能仍然会遇到段落最后部分文本被截断的问题。在短语中,H1 的宽度切断了字母的最后部分,因此我直接在有问题的单词中添加了一个不间断空格。
B&A 示例:

<h3>Nuestra visión de la Seguridad Informática </h3>

然后...

<h3>Nuestra visión de la Seguridad  Informática </h3>

瞧!
所以,三个补丁来修复一个旧的 php 字体插件......你的帮助对我来说是黄金。谢谢!

Thanks. i would use font-face to fix the problem, but BOTH answers (on those php´s) made the trick.

The problem was with stable version 1.2, then I found v2.0beta3 out there. PROBLEM WAS WITH CHROME , by the way...

Oh... i you use mode=´wrap´, you´ll probably still have the problem with chopped text at the last part of the paragraph. In a phrase, the width of an H1 cuts off the last part of the letter, so I added a non breaking space directly to the problematic word.
Example B&A:

<h3>Nuestra visión de la Seguridad Informática </h3>

then...

<h3>Nuestra visión de la Seguridad  Informática </h3>

Voilá!
So, three patches to fix an OLD php font plugin... and your help was gold for me. Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文