phuang07
phuang07

Reputation: 981

How to generate webfont dynamically from webfont service?

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.

Upvotes: 2

Views: 459

Answers (1)

robertc
robertc

Reputation: 75707

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.

Upvotes: 1

Related Questions