How to Control XML Fonts
The simplest way to control XML (eXtensible Markup Language) fonts is to use a style sheet. These style sheets allow you to control the properties of a font, such as size, weight and color. Each font property is defined in a style sheet that links to your XML file. For every tag in your XML file, the font properties let you define how the font appears on the browser page. You can change the size of a font from small to large, the weight from normal to bold, and the color from black to blue simply by assigning values to each font property.
Instructions
-
-
1
Launch an HTML (Hyper Text Markup Language) editor such as Notepad.
-
2
Type the code below.
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="fontprops.css"?>
<BIGFONT>
This is a larger font size of 48 points
<BOLDFONT>
This is a bold font
</BOLDFONT>
<COLORFONT>
This font is the color blue
</COLORFONT>
</BIGFONT> -
-
3
Click "File," "Save" and type "fontprops.xml" in the "Save as type" section.
-
4
Click the "Save" button to save this XML file containing the fonts controlled by style sheets.
-
5
Click "File," "New" and type in the following.
BIGFONT {font-size: 48pt; display: block}
BOLDFONT {font-weight: bold}
COLORFONT {color: blue}
This assigns the values to the font properties. -
6
Click "File," "Save" and type "fontprops.css" in the "Save as type" section.
-
7
Click the "Save" button to save this CSS (Cascading Style Sheet) file in the same directory as the XML file. This file controls the XML fonts using font properties.
-
8
Open "fontprops.xml," with your Internet browser. Each XML tag and its control will be displayed. The large font size is 48 points, the bold font is bold and the blue font is displayed in the color blue. Each XML font is controlled by the font property values specified in the style sheet.
-
1
References
Resources
- Photo Credit http www image by mbs from Fotolia.com