nsISVGRendererGlyphMetrics

IID:8665f6e9-6ed6-4ff8-b511-46c8068b3960
Inherits From:nsISupports

\addtogroup renderer_interfaces Rendering Engine Interfaces One of a number of interfaces (all starting with nsISVGRenderer*) to be implemented by an SVG rendering engine. See nsISVGRenderer for more details.

The SVG rendering backend uses this interface to communicate to the rendering engine-native glyph metrics objects.

A glyph metrics object is instantiated by the backend for a given nsISVGGlyphMetricsSource object with a call to nsISVGRenderer::createGlyphMetrics(). The glyph metrics object is assumed to store a reference to its associated source object and provide metrics information about the (composite) glyph described by nsISVGGlyphMetricsSource::characterData, nsISVGGlyphMetricsSource::font, nsISVGGlyphMetricsSource::canvasTM, and other relevant style such as nsISVGGlyphMetricsSource::strokeWidth.


Constants

PRUint16 BASELINE_ALPHABETIC = 0
PRUint16 BASELINE_HANGING = 1
PRUint16 BASELINE_IDEOGRAPHC = 2
PRUint16 BASELINE_MATHEMATICAL = 3
PRUint16 BASELINE_CENTRAL = 4
PRUint16 BASELINE_MIDDLE = 5
PRUint16 BASELINE_TEXT_BEFORE_EDGE = 6
PRUint16 BASELINE_TEXT_AFTER_EDGE = 7

Properties

readonly float advance

Untransformed width of the composite glyph in pixels.

readonly nsIDOMSVGRect boundingBox

Untransformed bounding box of the composite glyph in pixel coordinates.


Methods

float getBaselineOffset ( PRUint16 baselineIdentifier ) nsIDOMSVGRect getExtentOfChar ( PRUint32 charnum ) PRBool update ( PRUint32 updatemask )

float getBaselineOffset ( PRUint16 baselineIdentifier )

Retrieve the (y-axis) offset of the given baseline.

Arguments:
baselineIdentifier: One of the BASELINE_* constants defined in this interface.
Returns:
Y-axis offset in pixels relative to top of bounding box.

nsIDOMSVGRect getExtentOfChar ( PRUint32 charnum )

Get the untransformed bounding box of an individual glyph.

Arguments:
charnum: The index of the character in nsISVGGlyphMetricsSource::characterData whose glyph bounding box is to be determined
Returns:
The untransformed bounding box in pixel coordinates

PRBool update ( PRUint32 updatemask )

Called by this object's corresponding nsISVGGlyphMetricsSource as a notification that some of the source's data (identified by paramter 'updatemask') has changed.

Arguments:
updatemask: An OR-ed combination of the UPDATEMASK_* constants defined in nsISVGGlyphMetricsSource.
Returns:
PR_TRUE if the metrics have changed as a result of the source update, PR_FALSE otherwise.

References

This interface is the type of the following properties:

nsISVGGlyphGeometrySource.metrics

This interface is returned from the following methods:

nsISVGRenderer.createGlyphMetrics

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com