Flash:动态文本字段上的抗锯齿字符而不嵌入字体,日语
我正在尝试在日本网站上的 Flash 动态文本字段上实现抗锯齿功能。 这些文本字段的内容不是固定数据。
我没有嵌入字体的选项,因为嵌入所有字符将导致 swf 文件非常重(3000kb+ 仅用于字体)。 这是因为日语中有大量独特的字符(实际上有数千个)。
基本上,任何使用动态文本字段的 Flash 站点都面临相同的选择:
- 减小文件大小并使用 仅设备字体(无 抗锯齿)
- 强制向用户下载 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:
- keep the filesize down and use
only Device Fonts (without
antialiasing) - 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
真的很愚蠢的“解决方法”,我确信它会被否决,但由于 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!
有很多可行的方法,但可能没有一个是您喜欢的。
There are a number of doable things, but none may be of your liking.
运行时字体嵌入怎么样?
您可以从设备字体开始,同时在后台加载日语字体。
加载日语字体后,您将进行调用,将字体更新为加载的字体并进行嵌入。
查看内置的 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!@
在 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.