Cufon - 一次替换多种字体/样式

发布于 2024-09-13 02:42:18 字数 311 浏览 3 评论 0原文

另一个cufon问题。

我基本上想做的是正确渲染这样的东西。

这是我曾经认为 cufon 会用字体的斜体版本替换斜体的最好产品

,但现在看来它只是为了替换恰好全部都是斜体的整个块。我是否正确理解用斜体版本或粗体等替换包含的单个单词(或短语)超出了 cufon 的能力?

老实说,我想做的是使用完全不同的斜体字体,特别是标题的块字体,以及 em 文本的精美脚本字体。

我想我运气不好,cufon 不能做这样的事情?我知道这有点不规则,但这似乎是重新创建设计师的“愿景”的潜在好方法,而无需为每个标题导出图像。

Another cufon question.

What I'm basically trying to do is render something like this correctly.

This is the best product ever

I had assumed that cufon would replace the italics with an italic version of the font, but now it would seem that it's only intended to replace a whole block that happened to ALL be italics. Do I correctly understand that replacing a contained single word (or short phrase) with italic version, or bold etc, is out of cufon's capabilities?

To be honest, what I wanted to do was use a completely different font for italic, specifically a block font for the heading, with a fancy script font for the em text.

I assume I'm out of luck and cufon can't do something like this? I know it's a bit irregular, but it seemed like a potentially good way to recreate this designer's "vision" without having to export an image for each heading.

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

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

发布评论

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

评论(1

維他命╮ 2024-09-20 02:42:18

您可以在 Cufon 中使用多种字体。

像这样进行 Cufon 调用:

<script type="text/javascript">
    Cufon.replace('span.regular', { fontFamily: 'RegularFont' });
    Cufon.replace('span.bold', { fontFamily: 'BoldFont' });
</script>

然后在短语中使用两个 span 元素,如下所示:

<span class="regular">This is <span class="bold">Cufon</span> using two fonts.</span>

You can use more than one font with Cufon.

Make your Cufon call like this:

<script type="text/javascript">
    Cufon.replace('span.regular', { fontFamily: 'RegularFont' });
    Cufon.replace('span.bold', { fontFamily: 'BoldFont' });
</script>

Then use two span elements in your phrase, like so:

<span class="regular">This is <span class="bold">Cufon</span> using two fonts.</span>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文