|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Netscapes Downloadable FontsNetscape Dynamic HTMLs downloadable fonts capability enables you to use any font in your HTML documents. You do this by creating a font definition file that would be placed on your Web server along with your other documents and content. When a user accesses a page that uses one of these fonts, the font definition file downloads with the HTML document the same as images, sounds, and other content displayed on the page. These downloaded fonts remain on the users system only while the page is in their cache. Thus, users cannot make use of the fonts for their own purposes. To make use of Netscapes downloadable fonts, you need to follow these steps:
Figure 24.5 shows an example of Netscapes downloadable fonts at worka sample file located on the DevEdge Online Web site at If you watch this file load into your Web browser, you will notice that the text first renders in the default font. Then, as the desired fonts download, the text re-renders.
Microsoft Web Embedding FontsIf you look through Microsofts Dynamic HTML documentation, you wont find any mention of a capability to download fonts to be used with your HTML documents. Microsoft has, in fact, developed technology to perform this functionthey just dont call it part of Dynamic HTML. You can find this technology, dubbed the Web Embedding Fonts Tool (WEFT), on Microsofts Typography Web site at In practice, using the WEFT is similar to using Netscapes downloadable fonts technology. As with Netscape, you can use a special tool to produce what Microsoft calls the font object to be linked to and downloaded with an HTML document. These font object files differ from regular fonts files in that they are prepared especially to be downloaded over the Webthey are compressed and made up of the subset of font characters actually used. These techniques can result in a savings of at least half the time otherwise requiredfar more if only a small number of characters is used. After the WEFT is used to create the font object file, it is linked into the HTML document. The syntax Microsoft uses to define an embedded font, included within a style sheet, is the following: @font-face { font-family: MyFont; font-style: normal; font-weight: normal; src: url(MYFONT0.eot); } In this case, the src attribute defines the actual location of the font object file. Although the tools used to define the font file and the format of the file itself differ between Microsofts and Netscapes systemsas well as the way that the fonts are linked into an HTML documentthe other features of the two systems are very similar. Both systems enable you to determine the domain from which the fonts can be served, and both allow the font to remain on the users system only as long as the user is viewing your pages. Figures 24.6 and 24.7 show an example of pages created using Microsofts font-embedding technology. The second figure shows what can happen to your carefully constructed Web page if, for some reason, the fonts it uses cannot be downloaded (or are otherwise unavailable).
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |