style.fontStyle (Property)

Controls the italicization of a font. The oblique and italic styles affect the displayed font in different ways.


CSS level - 1
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.fontStyle
CSS syntax:font-style: aStyle
Argument list:aStyleA font style value

Fonts can be styled to present themselves in a slanted appearance. It is not commonly realized that an italic and oblique font are not the same. A fully featured font engine provides both oblique and italic font styles. A less well featured font engine will simulate the effect by slanting the upright characters to make them appear to be italic. Other systems may simulate italic with oblique and vice versa.

The differences between the italic and oblique faces is in the treatment of certain characters such as a small letter a. In one model the same letter form as is used for the upright font is drawn with its verticals tilted at an angle. In the other the letter form is still drawn tilted but an alternative shape is used. In a properly supported system with all the special font renderings available, the characters will be specially drawn so they look clean when slanted. Simply skewing the upright characters does not preserve the character shape as accurately.

The following keywords can be applied to this property:


See also:JSSTag.fontStyle, String.italics(), String.sub(), String.sup(), style.font