Flash:动态文本字段上的抗锯齿字符而不嵌入字体,日语

发布于 2024-07-17 20:33:58 字数 379 浏览 9 评论 0原文

我正在尝试在日本网站上的 Flash 动态文本字段上实现抗锯齿功能。 这些文本字段的内容不是固定数据。

我没有嵌入字体的选项,因为嵌入所有字符将导致 swf 文件非常重(3000kb+ 仅用于字体)。 这是因为日语中有大量独特的字符(实际上有数千个)。

基本上,任何使用动态文本字段的 Flash 站点都面临相同的选择:

  1. 减小文件大小并使用 仅设备字体(无 抗锯齿)
  2. 强制向用户下载 3mb+ 字体 显示平滑的抗锯齿字体。

我问过一些日本朋友,他们说“Shoganai!” (翻译:“没办法”)。 有人有想法吗?

ps:不幸的是,silverlight 也不是一个选择。

I'm trying to achieve antialiasing on dynamic textfields in flash on a Japanese site. The content of these textfields is not fixed data.

I don't have the option to embed the fonts, since embeddeding all characters will result in a very heavy swf file(3000kb+ just for the fonts). This is due to the fact that there's a large number of unique characters in japanese(literally thousands).

Basically, any flash site using dynamic textfields faces the same choice:

  1. keep the filesize down and use
    only Device Fonts (without
    antialiasing)
  2. force a 3mb+ font download to the user
    to display smooth antialiased fonts.

I've asked around to some japanese friends, and they said "Shoganai!" (translation: "can't be helped"). Anybody have ideas?

ps: unfortunately, silverlight is not an option either.

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

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

发布评论

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

评论(4

折戟 2024-07-24 20:33:58

真的很愚蠢的“解决方法”,我确信它会被否决,但由于 flash.text.TextField 继承了 flash.display.DisplayObject,因此您可以使用内置过滤器(例如 flash.filters.Blur)来模糊文本水平和垂直各半个像素。

这会消耗更多的CPU。

编辑:
在使用 CS4 进行了一些工作之后,我发现了一个完美的方法来做到这一点,而无需额外的 CPU 开销! 结果将看起来 1:1 与“静态文本”渲染完全相同。 我相信在 CS3 下同样可以工作,因为我记得有类似的选项。

选择文本后,在属性下选择“反锯齿”,然后选择“自定义反锯齿”。 将“厚度”设置为 100,将清晰度设置为 0。这对我来说很有效!

Really dumb 'workaround', and I'm sure it'll get downvoted, but since flash.text.TextField inherits flash.display.DisplayObject, you can use the built-in filters such as flash.filters.Blur to blur the text by half a pixel horizontally and vertically.

This will consume a little more CPU.

EDIT:
After working a little bit with CS4, I found ther perfect way to do it without the extra CPU overhead! The result will look 1:1 exactly like 'static text' render. I believe the same will work under CS3 as I recall a similar option.

While the text is selected, under properties, select 'Anti-alias' and select 'Custom Anti-alias'. Set the Thickness to 100 and the sharpness to 0. That did the trick for me!

謸气贵蔟 2024-07-24 20:33:58

有很多可行的方法,但可能没有一个是您喜欢的。

  • 升级到 Flash 10。 字体不抗锯齿的问题仅限于 Windows:linux 和 macO 无论如何都可以正确地抗锯齿设备字体。 现在,从 Flash 10 开始,它也可以在 Windows 上运行,但您需要针对 Flash 10 进行编译才能使其运行。 如果您有能力以 Flash 10 为目标,这可能是最好的方法。
  • 限制可以使用的字符数,并仅嵌入所需的字符。 这适用于任何 Flash 版本,但在许多情况下可能不实用。
  • 放弃并使用设备字体:如果上述两种方式在您的情况下都不可行,我认为这确实是一个 shouganai 情况。

There are a number of doable things, but none may be of your liking.

  • Upgrade to Flash 10. The problem of fonts being non anti-aliased is windows-only : linux and macOs both anti-alias device fonts correctly anyway. Now, from Flash 10, it works on windows too, but you need to compile for Flash 10 for it to work. This is probably the best way if you can afford to target Flash 10.
  • Limit the number of characters you can use, and embed only the needed characters. This will work on any Flash version, but might not be practical in many cases.
  • Give up and use device fonts : if both the above ways are not possible in your case, I think this is really a shouganai case.
静水深流 2024-07-24 20:33:58

运行时字体嵌入怎么样?

您可以从设备字体开始,同时在后台加载日语字体。
加载日语字体后,您将进行调用,将字体更新为加载的字体并进行嵌入。

查看内置的 GAIA 框架,以轻松实现运行时字体嵌入。

对于更新部分,我编写了一个记录字体及其文本格式的数组。
然后,当加载字体时,它会引用数组,该数组循环并更新注册到它的所有文本字段。

看来可行。

Shoganai 是一个 kop out...... ganbatte 一路!@

How about runtime font embedding.

You can start with device fonts while loading the japanese font in the background.
When the japanese font has loaded you make a call that updates the font to the loaded font and does the embedding.

Check out GAIA framework for easy runtime font embedding as it's built in.

for the update part, I write an array that records the font and it's text format.
Then when a font is loaded it references the array which loops and updates all the text fields that are registered to it.

Seems to work out.

Shoganai is a kop out...... ganbatte all the way!@

美羊羊 2024-07-24 20:33:58

在 LiraNuna 的想法之上......

我看到了一篇文章类似的路径,但他们的目标也是进行遮罩...他们建议将影片剪辑绘制为位图。 这也可能会释放 CPU,因为您的过滤器仅用于初始渲染,然后您可以摆脱它们。

on top of LiraNuna's idea....

I saw one article along a similar path, but they were aiming to do masking as well... they suggested drawing the movieclip to bitmap. this might also free up CPU as your filters would only be used for the initial rendering, and then you could get rid of them.

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