0

I want to implement a font and color picker in my project. I implemented the color picker, I got it the code, but still I don't get the code to implement the font picker. Does any one know?

Thanks in advance.

Jason Berkan
  • 8,734
  • 7
  • 29
  • 39
Testadmin
  • 2,880
  • 9
  • 49
  • 71
  • It 'depends' anyway. How do you determine which fonts the user should be able to pick from? – Quentin Oct 22 '09 at 11:38
  • See my answer :) Haven't known yet, too. Btw: The questioner has 25 questions open... – guerda Oct 22 '09 at 11:42
  • Ooops. I just counted them and failed to notice the paging. – Quentin Oct 22 '09 at 13:25
  • But I mean "Do you want to try to determine the fonts on the user's system? Do you want to provide a predetermined list? etc". The whole issue of choosing fonts for the WWW is a tricky one if you are a web developer. Once you start taking in third party choices, you need to hide as much of that complexity as you can, and how much you can depends on what the choice of font is going to be used for. A page that only the user visits, a public page, and a server generated PDF are all very different use cases. – Quentin Oct 22 '09 at 13:28

2 Answers2

0

I found a StackOverflow question with a similar problem: Detecting font in Javascript. There I found this solution to list all installed fonts:

This page can list all of your installed and well known fonts so you could use his code (with permission!) and put them in a picker list.

Disclaimer: This method is not very fast and won't work perfectly!

Community
  • 1
  • 1
guerda
  • 23,388
  • 27
  • 97
  • 146
0

Need code snippet?

<?php header("Content-type: text/css"); 

$backgroundcolor = "#00FFF0";

$textcolor = " #0033FF";
?>
body {
 background:<?php  echo $backgroundcolor?>;
 color:<?php echo $textcolor?>;
}

Someone told me this works well with Javascript and on your tags it said PHP or Javascript.

Newb
  • 658
  • 5
  • 17
  • 30