TinyLine 2.5

com.tinyline.svg
Class SVGFontElem

java.lang.Object
  extended by com.tinyline.svg.SVGNode
      extended by com.tinyline.svg.SVGFontElem

public class SVGFontElem
extends SVGNode

The SVGFontElem class implements the 'font' element.

The 'font' element defines an SVG font. The SVGFontElem consists of a collection of SVGGlyphElems together with the information necessary to use those glyphs.

The SVGFontElem includes the information necessary to map characters to glyphs, to determine the size of glyph areas and to position the glyph area.

The characteristics and attributes of SVGFontElem correspond to the SVG fonts. Various font metrics, such as advance values and baseline locations, and the glyph outlines themselves, are expressed in units that are relative to an abstract square whose height is the intended distance between lines of type in the same type size.

This square is called the EM square and it is the design grid on which the glyph outlines are defined. The value of the units-per-em attribute on the SVGFontElem specifies how many units the EM square is divided into. Common values are, for example, 1000 (Type 1) and 2048 (TrueType, TrueType GX and Open-Type).

The design grid for SVGFontElem fonts, along with the initial coordinate system for the glyphs, has the y-axis pointing upward for consistency with accepted industry practice for many popular font formats.

Version:
1.9

Field Summary
 TinyFont tfont
           
 
Fields inherited from class com.tinyline.svg.SVGNode
animatedVals, attrs, bounds, children, color, display, fill, fillOpacity, fillRule, fontFamily, fontSize, fontStyle, fontWeight, helem, id, opacity, outlined, ownerDocument, parent, stopColor, stopOpacity, stroke, strokeDashArray, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, strokeOpacity, strokeWidth, textAnchor, transform, visibility, xmlSpace
 
Constructor Summary
SVGFontElem(SVGFontElem src)
          Creates a copy of the given SVGFontElem object.
 
Method Summary
 SVGNode copyNode()
          Constructs a copy of the given node.
 int createOutline()
          Creates an outline of this node.
 java.lang.Object getAttribute(int hattr)
          Returns the value object for the given attribute, or null object otherwise.
 int init()
          Inits this node.
 void paint(SVGRaster renderer)
          Draws this node.
 int setAttribute(int hattr, java.lang.Object value)
          Assigns or modifies the value of the specified attribute.
 
Methods inherited from class com.tinyline.svg.SVGNode
addChild, contains, getBounds, getCapStyle, getCurrentColor, getDashArray, getDashOffset, getDevBounds, getDisplay, getFillColor, getFillOpacity, getFillRule, getFontFamily, getFontSize, getGlobalTransform, getJoinStyle, getLineThickness, getMiterLimit, getNodeById, getOpacity, getStopColor, getStopOpacity, getStrokeColor, getStrokeOpacity, getTextAnchor, getVisibility, intersects, isDisplay, isVisible, matchUserAgent, nodeHitAt, removeChild, resolveColor, seekAElem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tfont

public TinyFont tfont
Constructor Detail

SVGFontElem

public SVGFontElem(SVGFontElem src)
Creates a copy of the given SVGFontElem object. (It DOES NOT copy the glyph table!).

Method Detail

copyNode

public SVGNode copyNode()
Constructs a copy of the given node.

Specified by:
copyNode in class SVGNode

createOutline

public int createOutline()
Creates an outline of this node.

Specified by:
createOutline in class SVGNode

getAttribute

public java.lang.Object getAttribute(int hattr)
Returns the value object for the given attribute, or null object otherwise.

Overrides:
getAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
Returns:
The value of the attribute or null.

init

public int init()
Inits this node.


paint

public void paint(SVGRaster renderer)
Draws this node.

Specified by:
paint in class SVGNode
Parameters:
renderer - The SVGRaster object that does the drawing.

setAttribute

public int setAttribute(int hattr,
                        java.lang.Object value)
                 throws java.lang.Exception
Assigns or modifies the value of the specified attribute.

Overrides:
setAttribute in class SVGNode
Parameters:
hattr - The attribute handle.
value - The value of the attribute.
Returns:
The error code that could be one of the following: SVG.ERR_OK, SVG.ERR_NUMBER_FORMAT, SVG.ERR_INVALID_ARG, SVG.ERR_NOT_FOUND, SVG.ERR_NOT_SUPPORTED, SVG.ERR_HIERARCHY_REQUEST
Throws:
java.lang.Exception - if the value type doesn not match to the attribute handle.

TinyLine 2.5

Provided under the terms of the TinyLine License Agreement that has been included with this distribution.