Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install a font in to a Server

Tags:

html

css

php

fonts

I have developed a PHP project. In this I want to implement the font style in Wendy Medium. But I don’t know how I install this font in my server.

Does any one know how to do this?

Thanks in advance.

like image 420
Testadmin Avatar asked Sep 10 '10 08:09

Testadmin


People also ask

How do I add a font to my server 2019?

Using an admin command prompt, copy the font file(s) to the "c:\windows\fonts" folder. Then edit the registry to add the font file name to the list in (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts) Reboot the machine. I have used this to install a bar code font on our terminal server for our warehouse users.

How do I install a TTF file?

To install the TrueType font in Windows: Click on Start, Select, Settings and click on Control Panel. Click on Fonts, click on File in the main tool bar and select Install New Font. Select the folder where the font is located. The fonts will appear; select the desired font that is titled TrueType and click on OK.


3 Answers

You can use CSS 3 to use your own fonts on a HTML/PHP page. To do this, you have to make something like this:

@font-face {
  font-family: WendyMedium;
  src: url(‘path/to/your/font/file.ttf’);
}

You can use this font then with the folowing line of code:

p { font-family: WendyMedium, Arial, sans-serif; }

Note that this is only supported by real webbrowsers (Chrome, Safari, Firefox, etc). You also need the have a license to use that font on your website.

like image 55
wgriffioen Avatar answered Oct 17 '22 16:10

wgriffioen


Just in case there’s any confusion, to use a font for a web page that you’ve generated via PHP, the font needs to be installed on the end-user’s machine, not your web server.

As mentioned in other answers, CSS3 provides a way for you to host the font file on your server (just like any other file), and reference it in the CSS, allowing the user’s browser to download it and render text on the page in that font.

However, as mentioned in Yi Yang’s comment, this often isn’t allowed by the font’s license. You’ll want to check whether and how this is allowed for Wendy Medium — perhaps see here: http://www.ascenderfonts.com/font/wendy-lp-family-3-fonts.aspx

like image 3
Paul D. Waite Avatar answered Oct 17 '22 16:10

Paul D. Waite


In addition to wgriffioen's answer: this website lets you generate a javascript that does something similar. It also works in IE7/8.

like image 1
Mischa Avatar answered Oct 17 '22 15:10

Mischa