cox.jmatt.java.MathTools.markup.svg
Class TextPen

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.StyleInfo
      extended by cox.jmatt.java.MathTools.markup.svg.StylePen
          extended by cox.jmatt.java.MathTools.markup.svg.TextPen

public class TextPen
extends StylePen

This StylePen subclass is designed and optimized for styling text. It contains methods to configure fonts and the way they should appear. Where possible the method arguments are designed to enforce proper values. Where not possible, be careful! All MathTools SVG font configuration options are here, but all StylePen methods are also available. Use as needed when needed.


Constructor Summary
TextPen()
          Standard constructor, nothing special.
 
Method Summary
 TextPen copyOf()
          Return a copy of this instance.
 TextPen setFontFamily(java.lang.String pValue)
          Set the 'font-family' attribute.
 TextPen setFontSize(java.lang.Double pValue)
          This method sets the 'font-size' attribute.
 TextPen setFontStyle(char pStyle)
          Set the font style (inclination).
 TextPen setFontVariant(boolean pSmallCaps)
          Set the 'font-variant' attribute.
 TextPen setFontWeight(char pWeight)
          Set the 'font-weight' attribute.
 TextPen setLetterSpacing(java.lang.String pValue)
          Set the spacing between the letters of the text.
 TextPen setTextAnchor(char pAlign)
          Set the anchor (alignment) of the text relative to its coordinates.
 TextPen setTextDecoration(char pValue)
          Set 'line-is-ness' of the text.
 TextPen setWordSpacing(java.lang.String pValue)
          Set the spacing between the words of the text.
 
Methods inherited from class cox.jmatt.java.MathTools.markup.svg.StylePen
setClipURL, setFill, setFillNonzero, setFillOpacity, setFillURL, setMaskURL, setName, setOpacity, setPen, setStroke, setStrokeDasharray, setStrokeDashOffset, setStrokeLinecap, setStrokeLinejoin, setStrokeMiterlimit, setStrokeWidth
 
Methods inherited from class cox.jmatt.java.MathTools.markup.StyleInfo
_addDeclaration, _addNDeclaration, _addNDeclaration, _declarations, _enableCopy, _uniqueName, configurate, configurateGlobalPizza, reset, toAttribute, toAttribute, toCSS, toRawCSS, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextPen

public TextPen()
Standard constructor, nothing special.

Method Detail

copyOf

public TextPen copyOf()
Return a copy of this instance.

Overrides:
copyOf in class StylePen

setFontSize

public TextPen setFontSize(java.lang.Double pValue)
This method sets the 'font-size' attribute.


setFontFamily

public TextPen setFontFamily(java.lang.String pValue)
Set the 'font-family' attribute.


setFontWeight

public TextPen setFontWeight(char pWeight)
Set the 'font-weight' attribute. Since this setting has limited, specific values it is set as a character. The characters used are: For non-numeric values the lowercase OR uppercase letters may be used.


setFontStyle

public TextPen setFontStyle(char pStyle)

Set the font style (inclination). There are three defined values:

As with other char-argument methods, this one accepts both uppercase and lowercase values.


setFontVariant

public TextPen setFontVariant(boolean pSmallCaps)
Set the 'font-variant' attribute. Since there are only two possibilities, true sets small-caps and false sets normal.

Parameters:
pSmallCaps - true for small-caps, false for normal.

setTextDecoration

public TextPen setTextDecoration(char pValue)

Set 'line-is-ness' of the text. This sets the 'text-decoration' property and valid values are:

Both upper- and lower-case values for these letters will work.


setTextAnchor

public TextPen setTextAnchor(char pAlign)

Set the anchor (alignment) of the text relative to its coordinates. Valid values are:

Uppercase values also work.


setLetterSpacing

public TextPen setLetterSpacing(java.lang.String pValue)
Set the spacing between the letters of the text. This can be 'normal' for normal spacing, a positive number to increase the space or a negative one to decrease it.


setWordSpacing

public TextPen setWordSpacing(java.lang.String pValue)
Set the spacing between the words of the text. This is 'normal' for normal spacing, positive to increase the space or negative to decrease it.