Results 1 to 3 of 3

Thread: Live preview of fonts

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Live preview of fonts

    Hi,
    I have a font shop, and I must admit I'm very jealous of the font sites that has this "type in your text and preview the font" script. I have come as far as realizing the font must be installed on the server along with the freetype library, but then what? Is there a ready made script? I am definately missing out on something I will be grateful for any help to solving this matter....

    Ellinor

  2. #2
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Maybe a mod of this script?

    http://www.kevinroth.com/rte/demo.htm

    This rich text editor would be fine to begin with, but how do I call the fonts installed on a server? If I put the ttf's in a folder named fonts how can I add them to this script?

    The code where the font selection is looks like this:
    Code:
    			document.writeln('			<select id="fontname_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id)">');
    			document.writeln('				<option value="Font" selected>[Font]</option>');
    			document.writeln('				<option value="Arial, Helvetica, sans-serif">Arial</option>');
    			document.writeln('				<option value="Courier New, Courier, mono">Courier New</option>');
    			document.writeln('				<option value="Times New Roman, Times, serif">Times New Roman</option>');
    			document.writeln('				<option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');
    			document.writeln('			</select>');
    Code:
    			document.writeln('				<option value="Font" selected>[Font]</option>');
    			document.writeln('				<option value="Arial, Helvetica, sans-serif">Arial</option>');
    			document.writeln('				<option value="Courier New, Courier, mono">Courier New</option>');
    			document.writeln('				<option value="Times New Roman, Times, serif">Times New Roman</option>');
    			document.writeln('				<option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');
    			document.writeln('			</select>');
    Code:
    			document.writeln('			<select id="fontname_' + rte + '" onchange="selectFont(\'' + rte + '\', this.id)">');
    			document.writeln('				<option value="Font" selected>[Font]</option>');
    			document.writeln('				<option value="Arial, Helvetica, sans-serif">Arial</option>');
    			document.writeln('				<option value="Courier New, Courier, mono">Courier New</option>');
    			document.writeln('				<option value="Times New Roman, Times, serif">Times New Roman</option>');
    			document.writeln('				<option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>');

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You're barking up the wrong tree, I'm afraid. You need a server-side script to generate an image with the text using the specified font. See this tutorial for one way (using PHP and GD) to do this.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •