# Easy question

**URL:** <https://www.ruby-forum.com/t/easy-question/108585>\
**Category:** Rails\
**Created:** [July 5, 2007, 2:46am UTC](https://www.ruby-forum.com/t/easy-question/108585 "2007-07-05T02:46:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [July 5, 2007, 2:46am UTC](https://www.ruby-forum.com/t/easy-question/108585/1 "2007-07-05T02:46:16Z")

</div>

How can I get the list of available fonts on a system in Ruby? It seems  
like there should be a built-in function that does it.

* * *

Yahoo! oneSearch: Finally, mobile search that gives answers, not web  
links.

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [July 5, 2007, 4:13am UTC](https://www.ruby-forum.com/t/easy-question/108585/2 "2007-07-05T04:13:19Z")

</div>

Many stylesheets contain a list of fonts, in order of descending  
preference. Just make sure that the last font is guaranteed to be  
available, Verdana for example.

body  
{  
font-family: Helvetica, Verdana;  
}

If you really want to offer a list of fonts to your users, it doesn’t  
sound pleasant. You need to use flash, and then retrieve the list from  
here using javascript. This link looks useful:  
[http://nevermore.pri.ee/2007/03/14/another-better-font-detection-using-javascript-flash/](http://nevermore.pri.ee/2007/03/14/another-better-font-detection-using-javascript-flash/)

Hope that helps.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![hotgazpacho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a587f6/32.png) [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Post date:** [July 5, 2007, 5:05am UTC](https://www.ruby-forum.com/t/easy-question/108585/3 "2007-07-05T05:05:23Z")

</div>

Hmm. I guess probably need to phrase the question a little differently.  
What I want to is get list of all the fonts on the system. This won’t be  
for a stylesheet or anything, it’s just there for a lookup table. The  
user won’t have contact with actual font - all I need is for them to be  
able to select one from a list.

Will

Chris [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:  
Many stylesheets contain a list of fonts, in order of descending  
preference. Just make sure that the last font is guaranteed to be  
available, Verdana for example.

body  
{  
font-family: Helvetica, Verdana;  
}

If you really want to offer a list of fonts to your users, it doesn’t  
sound pleasant. You need to use flash, and then retrieve the list from  
here using javascript. This link looks useful:  
[http://nevermore.pri.ee/2007/03/14/another-better-font-detection-using-javascript-flash/](http://nevermore.pri.ee/2007/03/14/another-better-font-detection-using-javascript-flash/)

Hope that helps.

Cheers,  
Chris

On Jul 5, 10:44 am, Will G. wrote:

> How can I get the list of available fonts on a system in Ruby? It seems like there should be a built-in function that does it.
> 
> * * *
> 
> Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.

* * *

Choose the right car based on your needs. Check out Yahoo! Autos new  
Car Finder tool.
