Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Figure 25.13 shows the Typograph screen with an HTML document loaded. By using Typograph’s 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.


NOTE:  HexMac has standalone versions of Typograph for Macintosh and Windows 95/NT platforms, as well as plug-in versions for BBEdit (Macintosh) and FrontPage (Windows 95/NT). For more information on Typograph, visit http://www.hexmac.com/.


CAUTION:  

As part of the burning process, you need to tell Typograph from which Internet domain the font information will be served. After the domain is stored in the font definition file, the font information in the definition file can be served only from that domain. If you are serving the same documents on multiple domains, you must burn a new definition file for the other domains.


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:

  RELREL is set equal to FONTDEF, signifying that the linked file is a font definition file.
  SRCSRC points to the URL where the font definition file can be found.

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”>>


FIGURE 25.13  HexMac’s Typograph simplifies the application of fonts to text and creates a font definition file for you.

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.


NOTE:  Font definition files end with the .pfr extension.

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>

Try to use the CSS approach to choosing a typeface wherever possible. When style sheets are more common on the Web, it is likely that the <FONT> tag will be deprecated and your document will not conform to standards.

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:

  POINT_SIZE—You can control the point size of the font by setting POINT_SIZE to the number of points high you want the text to be.
  WEIGHTWEIGHT controls the boldness of the font and can be set to a value between 100 and 900 in increments of 100. A value of 100 is the least bold and a value of 900 is the most bold. Using WEIGHT gives you finer control over boldness than the <B> tag, which always uses the highest level of boldness.

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.

ON THE WEB
http://developer.netscape.com/dynhtml/ Netscape’s own take on Dynamic HTML, how its functionality is integrated into the Navigator browser, and how to develop Dynamic HTML content.
http://www.all-links.com/dynamic/ The Dynamic HTML Index contains frequently asked questions about Dynamic HTML and provides links to sites that answer the questions.
http://www.dhtmlzone.com/ Hosted by Macromedia, this site looks at developing Dynamic HTML for both Netscape and Microsoft browsers.


Previous Table of Contents Next


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.