views:

43

answers:

1

Is there a way to style text font dynamically base on selected font in a list? For example, we can see this in Microsoft Word, where you can highlight some text and then change the font style by selecting a font style from the font dropdown box. I am trying to create a component similar to this in the browser. Current I am using the webfont services provides by fonts.com, however, it looks like the font rendering only happen at page load time, and not able to do it dynamically. Anyone has anyway way to tackle this problem? Many thanks.

+1  A: 

You ought to be able to do something with Google/Typekit's WebFont Loader library. Create an array of WebFontConfig objects against your drop down box then pass the relevant object into WebFont.load in the onchange event.

robertc
Thanks for the suggestion. Does Google/Typekit support Asian font? Where else I can get Asian font?
@user373707 I think you'll have to determine that on a font by font basis, for example Droid Sans claims to support "Simplified Chinese (GB2312), Traditional Chinese (Big 5), Japanese (JIS 0208) and Korean (KSC 5601)" http://www.droidfonts.com/droidfonts/
robertc