You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by hi...@apache.org on 2001/04/01 18:08:45 UTC

cvs commit: xml-batik/sources/org/apache/batik/css/value FontWeightResolver.java

hillion     01/04/01 09:08:45

  Modified:    sources/org/apache/batik/css/value FontWeightResolver.java
  Log:
  Fixed a regression in font-weight handling.
  
  Revision  Changes    Path
  1.7       +12 -2     xml-batik/sources/org/apache/batik/css/value/FontWeightResolver.java
  
  Index: FontWeightResolver.java
  ===================================================================
  RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/value/FontWeightResolver.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FontWeightResolver.java	2001/03/27 13:36:22	1.6
  +++ FontWeightResolver.java	2001/04/01 16:08:44	1.7
  @@ -23,7 +23,7 @@
    * property.
    *
    * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
  - * @version $Id: FontWeightResolver.java,v 1.6 2001/03/27 13:36:22 hillion Exp $
  + * @version $Id: FontWeightResolver.java,v 1.7 2001/04/01 16:08:44 hillion Exp $
    */
   public class FontWeightResolver implements RelativeValueResolver {
   
  @@ -97,7 +97,17 @@
                   prop = (CSSOMReadOnlyValue)sd.getPropertyCSSValue(getPropertyName());
                   im = prop.getImmutableValue();
                   if (im.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
  -                    val = new CSSOMReadOnlyValue(im);
  +                    if (im == ValueConstants.NORMAL_VALUE) {
  +                        val = new CSSOMReadOnlyValue
  +                            ((b)
  +                             ? createFontWeight(context.getBolderFontWeight(400))
  +                             : createFontWeight(context.getLighterFontWeight(400)));
  +                    } else {
  +                        val = new CSSOMReadOnlyValue
  +                            ((b)
  +                             ? createFontWeight(context.getBolderFontWeight(700))
  +                             : createFontWeight(context.getLighterFontWeight(700)));
  +                    }
                   } else {
                       float f = im.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
                       val = new CSSOMReadOnlyValue
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org