Predefined attribute values / Fonts |
Use the fontSize style attribute to influence the size of a font.
{ generic-size | pointspt | sizeem }
Specify either a generic font size, an absolute size in points with the "pt" unit, or a relative size with the "em" unit.
Absolute sizes (using the "pt" suffix) define a font size in physical points. Physical points are much like pixels, in that they are fixed-size units and cannot scale in size. For example, on HTML pages using CSS styles, one point is equal to 1/72 of an inch.
Relative sizes (using the "em" suffix) define a font size in a scalable size unit that adapts to the front-end platform, where one "em" unit results in the same size as the size of the default font on the platform. For example, if the size of the platform default font is 16 points, 1em = 16pt, 2em = 32pt, etc.
Generic font sizes are interpreted by the front end according to the graphical capability of the platform.
Generic font size name | Definition |
---|---|
xx-small |
Tiny font size |
x-small |
Extra-small font size |
small |
Small font size |
medium |
Medium font size |
large |
Large font size |
x-large |
Extra-large font size |
xx-large |
Huge font size |
You can also specify an absolute font size, by giving a numeric value followed by the units such as pt or em:
<StyleAttribute name="fontSize" value="medium" /> <StyleAttribute name="fontSize" value="xx-large" /> <StyleAttribute name="fontSize" value="12pt" /> <StyleAttribute name="fontSize" value="1em" />