views:

2223

answers:

4

Hi, 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.

+1  A: 

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!

LiraNuna
Well, I'm looking for ideas so it's all good :)
sthg
a glow 1 pixel with 1000% strength with a contrast color will also be nice to device font
Unreality
haha, good idea LiraNuna. i just added a 1.25px blurX and blurY (quality: low) to an 11pt arial device textfield. it actually doesn't look that bad on both mac and pc.
taber
A: 

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!@

A: 

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.

Assembler
+1  A: 

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.
Jean
Kind of shoganai, as far as i know. I've discussed the issue with several japanese flash designers, and got pretty much the same response from each. I'll give the flash 10 option a try, thanks for the tip.
sthg