Wordpress FLIR(Facelift Image Replacement)插件剪切文本末尾
我正在使用启用了 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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道很久以前就有人问过这个问题,但在研究这个问题时我想出了一个解决方案。我读到的每一页都是一群人在争论问题的根源并重现它,但没有人提供解决方案。
这并不能从根本上解决问题,但效果很好。打开generate.php
查找:
替换为:
它所做的只是在每个输入字符串后强制添加一个空格。该空间与文本的其余部分一起渲染,但被切断(因此您看不到它)。这不会将空间添加到实际的 HTML 中,因此如果使用文本浏览器呈现、不使用 FLIR 呈现或由爬网程序访问(用于 SEO),则不会显示额外的空间。它仅插入到创建图像的 PHP 函数中。
搜索了大约一个小时后,我认为谷歌上至少有一个修复程序会很有帮助。
编辑:这不适用于具有字母间距的文本。我正打算放弃,只是不使用字母间距,但我发现这有效(同样,没有从源头上解决问题,而是以相同的方式解决视觉问题)。打开 inc-flir.php
查找:
替换为:
这会在图像两侧插入与中间相同的空间量每个字符。我在左侧和右侧都添加了空格,以便文本大部分居中。
再次编辑:
哦,是的!并且不要忘记清理 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:
Replace With:
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:
Replace With:
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!
谢谢。我会使用 font-face 来解决这个问题,但是两个答案(在那些 php 上)都成功了。
问题出在稳定版本 1.2 上,然后我发现了 v2.0beta3 。顺便说一下,问题出在 Chrome 上...
哦...如果您使用 mode='wrap',您可能仍然会遇到段落最后部分文本被截断的问题。在短语中,H1 的宽度切断了字母的最后部分,因此我直接在有问题的单词中添加了一个不间断空格。
B&A 示例:
然后...
瞧!
所以,三个补丁来修复一个旧的 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:
then...
Voilá!
So, three patches to fix an OLD php font plugin... and your help was gold for me. Thanks!