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

Mar 27th, 2007, 11:39 AM

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.


Philip M
Mar 27th, 2007, 04: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.

Mar 27th, 2007, 05: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.

<STYLE>@font-face {font-family:comic; src:url(http://abc.domain.com/fonts/comicbold.eot);}
<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.