Greetings,
I'm in the middle of writing a Flash application which has multilingual support. My initial choice of font for this was Tahoma, for its Unicode support. The client prefers a non-standard font such as Lucida Handwriting. Lucida Handwriting doesn't have the same, say, Cyrillic support as Tahoma, which poses a problem that there are a few ways to solve, and I'd like to ask for your advice on which is preferable:
我正在编写一个具有多语言支持的Flash应用程序。我最初选择的字体是Tahoma,因为它支持Unicode。客户更喜欢Lucida手写等非标准字体。 Lucida手写与Tahoma没有相同的西里尔支持,这提出了一些问题,有几种方法可以解决,我想问你的建议哪个更好:
From what I understand, I could:
根据我的理解,我可以:
- Give the client a list of fully Unicode-compatible (Cyrillic, Hebrew, Arabic, Traditional Chinese, East Asian, etc) fonts to choose from. (I have no idea where to get such a list; my search of the web has resulted only in lists of partially unicode-compliant fonts. Try http://look.fo/list-of-unicode-compliant-fonts as a good starting point to see where I looked).
- Depending on the client's location (which we already have), render in Lucida Handwriting for English-speaking users and in Tahoma for international users. This may be somewhat of a headache; has anyone had any experience with this approach?
- Build a new font (IE, AlexeyMK Bold) which uses Lucida Handwriting for English and Tahoma for everything else. This ads something like 500k to the weight of the Flash file, but should (if I understand correctly) only be loaded the first time.
为客户端提供完全兼容Unicode(西里尔语,希伯来语,阿拉伯语,繁体中文,东亚语等)字体的列表供您选择。 (我不知道从哪里获得这样的列表;我对网络的搜索仅产生了部分符合unicode的字体列表。请尝试http://look.fo/list-of-unicode-compliant-fonts起点看我看的地方)。
根据客户的位置(我们已经拥有),为英语用户提供Lucida手写,为国际用户提供Tahoma。这可能有些令人头痛;有没有人有这种方法的经验?
构建一个新的字体(IE,AlexeyMK Bold),其中使用Lucida手写英语和Tahoma用于其他一切。这个广告类似于Flash文件重量的500k,但应该(如果我理解正确的话)只在第一次加载。
What do you advise? Which of these are reasonable solutions, and which are completely out there? Is there a way that I'm not thinking of?
你有什么建议?以下哪些是合理的解决方案,哪些完全在那里?我有没有想到的方法?
Much thanks! Alexey
非常感谢!阿列克谢
EDIT: A good article on the subject: http://www.itworld.com/print/58558
编辑:一篇关于这个主题的好文章:http://www.itworld.com/print/58558
1 个解决方案
#1
2
Well, ultimately you have only two real choices: either you embed a font in your SWF, guaranteeing what your fonts will look like, or you don't, and use device fonts. (Or a mixture of the two, using embedded or device fonts depending on region.)
好吧,最终你只有两个真正的选择:要么在SWF中嵌入字体,要么保证你的字体是什么样的,要么你没有,并使用设备字体。 (或两者的混合,使用嵌入式或设备字体,具体取决于地区。)
If you don't embed any fonts, then whatever font you define for your text is ultimately just a suggestion - what the user will see is device fonts, being rendered by their own machine (using the fonts on that machine). So you can "suggest" Tahoma, but what the user sees will depend on whether they have that font (and it might vary for, say, Mac versions of the font vs. PC versions). Naturally this also depends on support; if they don't have Asian fonts then then they won't see any Chinese for example. (Note: you can also choose a font like "_sans", which just tells the client to use its standard sans-serif font. My guess is that in practice this will wind up being the same font that would have been chosen if you'd defined "Tahoma", but YMMV.)
如果您没有嵌入任何字体,那么您为文本定义的任何字体最终都只是一个建议 - 用户将看到的是设备字体,由他们自己的机器(使用该机器上的字体)呈现。因此,您可以“建议”Tahoma,但用户看到的将取决于他们是否具有该字体(并且可能因Mac版本的字体与PC版本而异)。当然这也取决于支持;如果他们没有亚洲字体,那么他们就不会看到任何中文。 (注意:你也可以选择像“_sans”这样的字体,它只是告诉客户使用它的标准sans-serif字体。我的猜测是,在实践中,如果你这样做,它将会被选择为相同的字体。 d定义“Tahoma”,但是YMMV。)
If you embed your fonts, then the user will see exactly what you expect them to, because the font is rendered by Flash and not the OS. But if you embed fully for all regions, including the glyphs needed for Chinese, then I think you'll find it adds considerably more than 500K.. more like 2-5MB in my experience. But maybe there are some details I'm missing. Anyway, for content to be delivered over the web I would generally assume that, at minimum, asian fonts should be device fonts.
如果嵌入字体,那么用户将看到您期望的字体,因为字体是由Flash而不是操作系统呈现的。但如果你完全嵌入所有地区,包括中文所需的字形,那么我认为你会发现它增加了超过500K ..更像是我的经验2-5MB。但也许有一些我遗漏的细节。无论如何,对于通过网络传送的内容,我通常会认为,亚洲字体至少应该是设备字体。
To add a word about a mixed solution, I've done this and it's doable. That is, assuming you can add the logic to your SWF, you could (for example) make two of each text field, one using embedded "Lucida whatever" and the other using non-embedded "_sans", and then at runtime make one of them invisible and put text in the other, depending on which region you're showing. (I did this by making a single LocalizedTextfield component, and having it read the locale out of a static property when it initialized.) Then you simply have to decide, for each locale, whether the file size is worth the display for that particular set of glyphs.
要添加关于混合解决方案的单词,我已经完成了这个并且它是可行的。也就是说,假设您可以将逻辑添加到SWF中,您可以(例如)创建两个文本字段,一个使用嵌入式“Lucida what”,另一个使用非嵌入式“_sans”,然后在运行时创建一个它们是不可见的,并将文本放在另一个中,具体取决于您显示的区域。 (我通过创建一个LocalizedTextfield组件,并在初始化时从静态属性中读取区域设置来完成此操作。)然后,您只需为每个区域设置决定文件大小是否值得显示该特定组字形。
The final word is, you can't necessarily assume that the file size incurred by your fonts will only be loaded once. If you make your content the straightforward way and embed fonts in your text fields, then the font info will be part of your SWF, and thus loaded every time no matter what. To externalize it you could make the Label component a separate file, and then the decision to load it or not is up to the browser's caching settings. You can also externalize the font resource itself and use it as a shared resource, but in AS2 this is somewhat hairy to get working. I've heard it's easier in AS3 but not done it myself.
最后一句话是,您不一定要假设您的字体引起的文件大小只会被加载一次。如果您以简单明了的方式制作内容并在文本字段中嵌入字体,那么字体信息将成为SWF的一部分,因此无论何时加载,都会加载。要将其外部化,您可以将Label组件设置为单独的文件,然后决定是否加载它取决于浏览器的缓存设置。您还可以将字体资源本身外部化并将其用作共享资源,但在AS2中,这样做有点毛茸茸。我听说AS3更容易,但我自己也没做过。
#1
2
Well, ultimately you have only two real choices: either you embed a font in your SWF, guaranteeing what your fonts will look like, or you don't, and use device fonts. (Or a mixture of the two, using embedded or device fonts depending on region.)
好吧,最终你只有两个真正的选择:要么在SWF中嵌入字体,要么保证你的字体是什么样的,要么你没有,并使用设备字体。 (或两者的混合,使用嵌入式或设备字体,具体取决于地区。)
If you don't embed any fonts, then whatever font you define for your text is ultimately just a suggestion - what the user will see is device fonts, being rendered by their own machine (using the fonts on that machine). So you can "suggest" Tahoma, but what the user sees will depend on whether they have that font (and it might vary for, say, Mac versions of the font vs. PC versions). Naturally this also depends on support; if they don't have Asian fonts then then they won't see any Chinese for example. (Note: you can also choose a font like "_sans", which just tells the client to use its standard sans-serif font. My guess is that in practice this will wind up being the same font that would have been chosen if you'd defined "Tahoma", but YMMV.)
如果您没有嵌入任何字体,那么您为文本定义的任何字体最终都只是一个建议 - 用户将看到的是设备字体,由他们自己的机器(使用该机器上的字体)呈现。因此,您可以“建议”Tahoma,但用户看到的将取决于他们是否具有该字体(并且可能因Mac版本的字体与PC版本而异)。当然这也取决于支持;如果他们没有亚洲字体,那么他们就不会看到任何中文。 (注意:你也可以选择像“_sans”这样的字体,它只是告诉客户使用它的标准sans-serif字体。我的猜测是,在实践中,如果你这样做,它将会被选择为相同的字体。 d定义“Tahoma”,但是YMMV。)
If you embed your fonts, then the user will see exactly what you expect them to, because the font is rendered by Flash and not the OS. But if you embed fully for all regions, including the glyphs needed for Chinese, then I think you'll find it adds considerably more than 500K.. more like 2-5MB in my experience. But maybe there are some details I'm missing. Anyway, for content to be delivered over the web I would generally assume that, at minimum, asian fonts should be device fonts.
如果嵌入字体,那么用户将看到您期望的字体,因为字体是由Flash而不是操作系统呈现的。但如果你完全嵌入所有地区,包括中文所需的字形,那么我认为你会发现它增加了超过500K ..更像是我的经验2-5MB。但也许有一些我遗漏的细节。无论如何,对于通过网络传送的内容,我通常会认为,亚洲字体至少应该是设备字体。
To add a word about a mixed solution, I've done this and it's doable. That is, assuming you can add the logic to your SWF, you could (for example) make two of each text field, one using embedded "Lucida whatever" and the other using non-embedded "_sans", and then at runtime make one of them invisible and put text in the other, depending on which region you're showing. (I did this by making a single LocalizedTextfield component, and having it read the locale out of a static property when it initialized.) Then you simply have to decide, for each locale, whether the file size is worth the display for that particular set of glyphs.
要添加关于混合解决方案的单词,我已经完成了这个并且它是可行的。也就是说,假设您可以将逻辑添加到SWF中,您可以(例如)创建两个文本字段,一个使用嵌入式“Lucida what”,另一个使用非嵌入式“_sans”,然后在运行时创建一个它们是不可见的,并将文本放在另一个中,具体取决于您显示的区域。 (我通过创建一个LocalizedTextfield组件,并在初始化时从静态属性中读取区域设置来完成此操作。)然后,您只需为每个区域设置决定文件大小是否值得显示该特定组字形。
The final word is, you can't necessarily assume that the file size incurred by your fonts will only be loaded once. If you make your content the straightforward way and embed fonts in your text fields, then the font info will be part of your SWF, and thus loaded every time no matter what. To externalize it you could make the Label component a separate file, and then the decision to load it or not is up to the browser's caching settings. You can also externalize the font resource itself and use it as a shared resource, but in AS2 this is somewhat hairy to get working. I've heard it's easier in AS3 but not done it myself.
最后一句话是,您不一定要假设您的字体引起的文件大小只会被加载一次。如果您以简单明了的方式制作内容并在文本字段中嵌入字体,那么字体信息将成为SWF的一部分,因此无论何时加载,都会加载。要将其外部化,您可以将Label组件设置为单独的文件,然后决定是否加载它取决于浏览器的缓存设置。您还可以将字体资源本身外部化并将其用作共享资源,但在AS2中,这样做有点毛茸茸。我听说AS3更容易,但我自己也没做过。