![]() |
![]() |
||||||
|
|||||||
Fonts are slightly more complex than colors and cursors. To use a font, you must first realize the font according to a font specification, and then associate the realized font with one or more presentation components. Until a font is actually associated with a presentation component, it is held in reserve as an inert resource that has no visual manifestation. The following example shows how to describe a font element inside a reserve element, and later access it through a Universal Resource Indicator (URI). Make this object in eNode Sandbox. The result should be similar to the following: ![]() The Example Explained The id attribute of the font element contains a user-defined ID that must be unique within the scope of the document. The ID is used to identify this resource when it is subsequently needed. The name attribute specifies a logical font name, which must be one of Serif, SansSerif, Dialog, DialogInput, Monospaced, or Symbol. If no name is specified, the name is set to Default. Although not shown in this example, the font element also supports a style attribute whose value could specify either or both of bold and italic. If both are specified, they must be separated by at least one space, but the order in which they are specified is immaterial. In other words, style="bold italic" is equivalent to style="italic bold". If the style attribute is missing (or a value is unrecognized), the style (or the unrecognized value) is assumed to be plain. The size attribute specifies the font size in points, where each point is approximately 1/72 of an inch. So, size="36" represents a font that is approximately 1/2 inch tall. The font element is finally associated with the label element through the latter’s font attribute. The value of the label element’s font attribute is a URI reference to the font element that exists inside the reserve element. Because the referenced element resides in the same document as the label element, the URI, in this case, consists only of the fragment identifier "#myFont". |
|||||||
|
Copyright © 2002 eNode, Inc. All Rights Reserved. |