All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.w3c.css.properties.css1.CssFontStyleCSS2 Maven / Gradle / Ivy

The newest version!
//
// $Id: CssFontStyleCSS2.java,v 1.4 2010-01-05 13:49:43 ylafon Exp $
// From Philippe Le Hegaret ([email protected])
//
// (c) COPYRIGHT MIT and INRIA, 1997.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css1;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssIdent;

/**
 *   

*    'font-style' *

*

* Value: normal | italic | oblique
* Initial: normal
* Applies to: all elements
* Inherited: yes
* Percentage values: N/A
*

The 'font-style' property selects between normal (sometimes referred to * as "roman" or "upright"), italic and oblique faces within a font family. *

A value of 'normal' selects a font that is classified as 'normal' in * the UA's font database, while 'oblique' selects a font that is labeled * 'oblique'. A value of 'italic' selects a font that is labeled 'italic', * or, if that is not available, one labeled 'oblique'. *

The font that is labeled 'oblique' in the UA's font database may * actually have been generated by electronically slanting a normal font. *

Fonts with Oblique, Slanted or Incline in their names will typically be * labeled 'oblique' in the UA's font database. Fonts with Italic, * Cursive or Kursiv in their names will typically be labeled * 'italic'. *

 *   H1, H2, H3 { font-style: italic }
 *   H1 EM { font-style: normal }
 * 
*

* In the example above, emphasized text within 'H1' will appear in a normal * face. * * @version $Revision: 1.4 $ */ public class CssFontStyleCSS2 extends CssProperty implements CssFontConstantCSS2 { int value; /** * Create a new CssFontStyleCSS2 */ public CssFontStyleCSS2() { // nothing to do } /** * Creates a new CssFontStyleCSS2 * * @param expression the font style * @exception InvalidParamException values are incorrect */ public CssFontStyleCSS2(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } setByUser(); if (expression.getValue() instanceof CssIdent) { int hash = ((CssIdent) expression.getValue()).hashCode(); for (int i=0; iprint */ public boolean isDefault() { return value == 0; } private static int[] hash_values; static { hash_values = new int[FONTSTYLE.length]; for (int i=0; i





© 2015 - 2024 Weber Informatics LLC | Privacy Policy