java.lang.Object | |
↳ | com.caverock.androidsvg.SVGExternalFileResolver |
Known Direct Subclasses |
Resolver class used by the renderer when processing Text and Image elements.
The default behaviour is to tell AndroidSVG that the reference could not be found.
Extend this class and override the methods if you want to customise how AndroidSVG treats font and image references.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SVGExternalFileResolver() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
isFormatSupported(String mimeType)
Called by renderer to determine whether a particular format is supported.
| ||||||||||
Typeface |
resolveFont(String fontFamily, int fontWeight, String fontStyle)
Called by renderer to resolve font references in <text> elements.
| ||||||||||
Bitmap |
resolveImage(String filename)
Called by renderer to resolve image file references in <image> elements.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Called by renderer to determine whether a particular format is supported. In particular,
this method is used in <switch> elements when processing requiredFormats
conditionals.
mimeType | A MIME type (such as "image/jpeg"). |
---|
resolveImage()
implementation supports this file format.
Called by renderer to resolve font references in <text> elements.
Return a Typeface
instance, or null if you want the renderer to ignore
this font and use the default Android font instead.
Note that AndroidSVG does not attempt to cache Typeface references. If you want them cached, for speed or memory reasons, you should do so yourself.
fontFamily | Font family as specified in a font-family style attribute. |
---|---|
fontWeight | Font weight as specified in a font-weight style attribute. |
fontStyle | Font style as specified in a font-style style attribute. |
Called by renderer to resolve image file references in <image> elements.
Return a Bitmap
instance, or null if you want the renderer to ignore
this image.
Note that AndroidSVG does not attempt to cache Bitmap references. If you want them cached, for speed or memory reasons, you should do so yourself.
filename | the filename as provided in the xlink:href attribute of a <image> element. |
---|