|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
Figure 25.13 shows the Typograph screen with an HTML document loaded. By using Typographs simple menus, you select text and apply a font to it, the same as you would if you were using a word processing program. When the document looks the way you want it, you use the Typograph Burn option to save the file, to set up the link in the document to the font definition file, and to create the font definition file itself.
If you use a different font definition file generation program, you may need to place the link to the definition file into your document manually. Two ways exist to link a definition file to a document. The first is to use the <LINK> tag in the document head. When linking to a font definition file with the <LINK> tag, you need to use the following attributes:
Thus a <LINK> tag that links to a font definition file might look like this: <LINK REL=FONTDEF SRC=<http://www.myserver.com/fonts/mydoc.pfr>>
The other approach is to link the font definition file inside the HTML <STYLE> element. The CSS specification supports a link such as the following: <STYLE TYPE=text/css> <!-- @fontdef url(<http://www.myserver.com/fonts/mydoc.pfr>) --> </STYLE> The <STYLE> implementation here is equivalent to the <LINK> implementation shown previously.
With the font definition file linked to your HTML document, you are free to use the fonts contained in the file anywhere in your document. Two approaches to this exist as well. One is to use the FACE attribute of the <FONT> tag just as you always would. FACE is set equal to a comma-delimited list of fonts to use in the order that the browser should try to apply them. For example, the HTML <FONT FACE=Palatino, Garamond, Clarendon, serif> This will be in Palatino, if possible. </FONT> will render the sentence This will be in Palatino, if possible. in Palatino. If Palatino is not available, the browser looks for Garamond, and then Clarendon, and finally, if none of the named fonts are available, it uses a serif font. The other way to go is to use the font-family characteristic available through the Cascading Style Sheet specification. Using CSS, you could express the same font choices in the preceding <FONT> tag as follows: <STYLE TYPE=text/css> <!-- P {font-family: Palatino, Garamond, Clarendon, serif} --> </STYLE> ... <P>This will be in Palatino, if possible.</P>
You get some additional flexibility if you opt to use the <FONT> tag because Netscape has extended the tag with a few more attributes. These are as follows:
With the downloaded typefaces specified in your HTML document, you are almost done. As a final step, you need to put the HTML file and the font definition file out on your server. Remember that the server must be in the domain you specified when creating the font definition file. You should publish both files to a location from which the server can serve them. Additionally, you need to add a MIME type to your server for the font definition file. MIME information is sent in front of a file to give Navigator a heads up as to what kind of file is coming down the pipe. For font definition files, you should add the MIME type application/font-tdpfr, paired with the file extension .pfr, to your server. After you or your server administrator make this addition to the MIME types file, you probably need to restart the server to get it to recognize the new MIME type. Netscape Navigator is already configured to handle the application/font-tdpfr MIME type and uses the information in the font definition file to render the typefaces in the file.
|
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. |