pbwest      2002/06/26 08:59:47

  Modified:    src/org/apache/fop/fo/expr Tag: FOP_0-20-0_Alt-Design
                        SystemFontFunction.java
  Log:
  Added 3 arg systemFontCharacteristic().  Added expandFontSHand().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +72 -5     xml-fop/src/org/apache/fop/fo/expr/Attic/SystemFontFunction.java
  
  Index: SystemFontFunction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/org/apache/fop/fo/expr/Attic/SystemFontFunction.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- SystemFontFunction.java   25 Jun 2002 14:06:03 -0000      1.1.2.1
  +++ SystemFontFunction.java   26 Jun 2002 15:59:46 -0000      1.1.2.2
  @@ -9,6 +9,8 @@
   
   import org.apache.fop.fo.Properties.Font;
   import org.apache.fop.fo.PropNames;
  +import org.apache.fop.fo.PropertySets;
  +import org.apache.fop.fo.expr.PropertyException;
   import org.apache.fop.fo.expr.FunctionNotImplementedException;
   
   /**
  @@ -20,9 +22,74 @@
       private static final String tag = "$Name$";
       private static final String revision = "$Revision$";
   
  -    public static PropertyValue systemFont(String font, int property)
  -        throws FunctionNotImplementedException
  +    /**
  +     * Return the <tt>PropertyValue</tt> appropriate to the <em>property</em>
  +     * of the argument.  <em>property</em> must be one of the font
  +     * characteristic properties in the expansion set of the <em>font</em>
  +     * shorthand property; <em>PropertySets.fontExpansion</em>.
  +     * @param property <tt>int</tt> index of the font characteristic property
  +     * to be returned.
  +     * @param font <tt>String</tt> name of the system font
  +     * @exception FunctionNotImplementedException
  +     * @exception PropertyException if the property is not appropriate or
  +     * if any other errors occur in the processing of the property
  +     */
  +    public static PropertyValue systemFontCharacteristic
  +        (int property, String font)
  +        throws FunctionNotImplementedException, PropertyException
       {
           throw new FunctionNotImplementedException("system-font");
  +    }
  +
  +    /**
  +     * Return the <tt>PropertyValue</tt> appropriate to the <em>property</em>
  +     * of the argument.  The value returned is the current value of the
  +     * font characteristic, named by <em>propName</em>, defined on the
  +     * system font named by <em>font</em>.  <em>propName</em> must be one of
  +     * characteristic properties in the expansion set of the <em>font</em>
  +     * shorthand property; <em>PropertySets.fontExpansion</em>.
  +     * @param property <tt>int</tt> index of the property for the
  +     * <tt>PropertyValue</tt> to be returned.
  +     * @param font <tt>String</tt> name of the system font
  +     * @param propName <tt>String</tt> name of font characteristic whose
  +     * current value is to be returned.
  +     * @exception FunctionNotImplementedException
  +     * @exception PropertyException if the property is not appropriate or
  +     * if any other errors occur in the processing of the property
  +     */
  +    public static PropertyValue systemFontCharacteristic
  +        (int Property, String font, String propName)
  +        throws FunctionNotImplementedException, PropertyException
  +    {
  +        throw new FunctionNotImplementedException("system-font");
  +    }
  +
  +    /**
  +     * Expand the <em>font</em> shorthand property defined for a named
  +     * system font, by providing a <tt>PropertyValueList</tt> containing
  +     * one element for each property expansion from the <em>font</em>
  +     * shorthand.  Individual values are derived by calling
  +     * <em>SystemFontFunction.systemFontCharacteristic</em> for each
  +     * property in the expansion.
  +     * @param property <tt>int</tt> index of the property for the
  +     * <tt>PropertyValue</tt> to be returned.
  +     * @param font <tt>String</tt> name of the system font
  +     * @return <tt>PropertyValueList</tt> containing a list of
  +     *  <tt>PropertyValue</tt>s, one for each property in the expansion of
  +     *  the <em>font</em> shorthand property.
  +     * @exception PropertyException
  +     */
  +    public static PropertyValueList expandFontSHand
  +        (int property, String font)
  +        throws PropertyException
  +    {
  +        // Get the array of indices of the properties in the
  +        // expansion of this shorthand
  +        ROIntArray expansion = PropertySets.fontExpansion;
  +        PropertyValueList list = new PropertyValueList(property);
  +        for (int i = 0; i < expansion.length; i++) {
  +            list.add(systemFontCharacteristic(expansion.get(i), font));
  +        }
  +        return list;
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to