1

I'm trying to design a font selection tool where a user can select one of the fonts shown.

I'm using this code:

<label style="font-family: TimesRoman;">
  <input type="radio" name="font" value="TimesRoman"/> sample 1
</label>

which displays "sample 1" in "Times Roman" fontface, and this can be selected using radio buttons.

I have installed many external fonts just like "TimesRoman" and I want to use their names in the style atribute so that "sample 1" will be displayed in their format, but I don't know the font family of external fonts. How do I obtain the font-family of installed fonts?

Dan
  • 1,130
  • 2
  • 20
  • 38
  • Usually is the font name (Verdana, Helvetica, MyCoolCustomFont...). But it'll work only if the font is available on the user machine, else you need to link to the font file (both in EOT and TTF format, for compatibility with all browsers) – Damien Pirsy Jan 26 '12 at 08:16
  • I am afraid I don't really understand what you are asking. – kapa Jan 26 '12 at 08:27
  • 4
    This question is nothing like the linked dupes. (s)he's asking, how to find out the family name (machine name, CSS name) of any arbitrary font. This is a variable within a font file, normally not shown to the users of most OS-standard font browser software, unless you know how to access it. It's not always the same as the font's title, e.g. fonts with 2+ words may add hyphens or underscores, and some foundaries tack on details like font weight. Info on how to access the actual font family name for CSS can be found here: http://rachaelmoore.name/posts/design/css/find-font-name-css-family-stack/ – user56reinstatemonica8 Oct 29 '12 at 12:38

1 Answers1

-2

You cant use all types of fonts. User need to have font in his machine or you have to use thirdparty font library like Google web fonts.

For the available fonts, your started scripting is fine.

You can also obtain the list of fonts a user has installed on her machine by using javascript/CSS. You could compare that with your list and only show elements of the fonts actually installed.

Community
  • 1
  • 1
Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
  • After asking this question.... they have blocked me from asking questions.... i dont even know the reason.... –  Jan 26 '12 at 08:27
  • 4
    It's because you have several questions you've failed to follow up on. Revisit your past question, mark some as answered if there are solutions. People don't like spending the time to help those that are ungrateful. – Scott Jan 26 '12 at 08:32
  • 1
    @user1120557: You could just read the shown link (or even the faq) - which explains the reasons. – mario Jan 26 '12 at 08:43
  • @user1120557 Even now you can go to your previous quesions and review. Mostly some time later your account may release, KIT with SO – Sameera Thilakasiri Jan 26 '12 at 09:02
  • i tried to mark my previous questions as "answered" but where do we have that option???? its not at all user friendly....iam still searching on how to make it as "answered" .. –  Jan 26 '12 at 15:50
  • @user1120557 At the left of the each anser you may see up and down arrows, those are used to up and down the answer, but for that you need some reputation(I think 15 or more), but bottom of up and down arrow you may see right symbol which used to accept the answer. – Sameera Thilakasiri Jan 27 '12 at 06:09
  • i have already accepted many answers to my questions..but still i dont have an access to "ask question" ..i think creating new username is the only solution.. what do you say??? –  Jan 28 '12 at 13:06