PDA

View Full Version : how to read the font in specific directory



snake_eyes
Mar 27th, 2007, 10:39 AM
hello,

Is there an script or another solution to let me read the font which is in the same directory in the host? because some of the fonts does not exists in the user PC.

Regards

Philip M
Mar 27th, 2007, 03:36 PM
No. JavaScript cannot read from or write to a file on the server. If the user does not have that particular font installed then the default font will be displayed.

CFMaBiSmAd
Mar 27th, 2007, 04:02 PM
This might get you started on how you would do this - http://en.wikipedia.org/wiki/Dynamic_fonts

Edit: Here is some specific info for IE that I found through searching -

Font Download
Internet Explorer 4.0 supports the use of dynamically downloaded fonts. Using the @font-face style attribute , a document can reference a font that is automatically downloaded, is used for the page only, and is discarded once the page is no longer displayed. The following example shows the use of downloaded fonts.

<HTML><HEAD>
<STYLE>@font-face {font-family:comic; src:url(http://abc.domain.com/fonts/comicbold.eot);}
</STYLE>
</HEAD>
<BODY>
<P STYLE="font-family:comic;font-size:18pt">this line uses the @font-face
style element to display this text using the Comic Sans MS font in 18-point
size and bold.
<P>
</BODY></HTML>