/    Sign up×
Community /Pin to ProfileBookmark

List of fonts in a drop down

Anyone know if there is a list of fonts available in a dropdown I could use?

[URL=”http://blog.flexexamples.com/2008/07/31/displaying-different-fonts-in-a-dropdown-menu-on-a-combobox-control-in-flex/”]This page[/URL] has what I want but it’s in Flash. I need it in plain HTML/JavaScript.

I obviously know how to code a simple drop down box in HTML font by font but it will take ages to put in all the fonts so I just wondered if someone has already done it.

Cheers

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@justinbarneskinJul 24.2012 — You can see if this is any help?

http://www.bitstorm.org/fontlist/
Copy linkTweet thisAlerts:
@captainscallJul 24.2012 — i don't know of any, but best thing i'd say to at least make it easier is create an array with all the fonts and then run a loop to spit out the options

[CODE]
fontsarray = new Array('times', 'blah', 'blah');

x = 0;
while ( x <= fontsarray.length )
{
document.write('<option>' + fontsarray[x] + '</option>');
x++;
}
[/CODE]


edit:

if you can find some simple list of fonts online you can copy it into notepad or whathaveyou and run a 'replace all' on the list symbol to replace it with ', and then fill in the rest of the ' chars. And there's your array.
×

Success!

Help @davidwhite spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...