MediaWiki 1.42.0
SVGReader Class Reference

Public Member Functions

 __construct ( $source)
 Creates an SVGReader drawing from the source provided.
 
 getMetadata ()
 

Static Public Member Functions

static scaleSVGUnit ( $length, $viewportSize=512)
 Return a rounded pixel equivalent for a labeled CSS/SVG length.
 

Public Attributes

const LANG_FULL_MATCH = 2
 
const LANG_PREFIX_MATCH = 1
 

Protected Member Functions

 read ()
 Read the SVG.
 

Detailed Description

Definition at line 36 of file SVGReader.php.

Constructor & Destructor Documentation

◆ __construct()

SVGReader::__construct ( $source)

Creates an SVGReader drawing from the source provided.

Parameters
string$sourceURI from which to read
Exceptions
InvalidSVGException

Definition at line 59 of file SVGReader.php.

References $source, and read().

Member Function Documentation

◆ getMetadata()

SVGReader::getMetadata ( )
Returns
array Array with the known metadata

Definition at line 122 of file SVGReader.php.

◆ read()

SVGReader::read ( )
protected

Read the SVG.

Exceptions
InvalidSVGException
Returns
bool

Definition at line 131 of file SVGReader.php.

Referenced by __construct().

◆ scaleSVGUnit()

static SVGReader::scaleSVGUnit ( $length,
$viewportSize = 512 )
static

Return a rounded pixel equivalent for a labeled CSS/SVG length.

https://www.w3.org/TR/SVG11/coords.html#Units

Parameters
string$lengthCSS/SVG length.
float | int$viewportSizeOptional scale for percentage units...
Returns
float Length in pixels

Definition at line 376 of file SVGReader.php.

References $matches.

Member Data Documentation

◆ LANG_FULL_MATCH

const SVGReader::LANG_FULL_MATCH = 2

Definition at line 41 of file SVGReader.php.

◆ LANG_PREFIX_MATCH

const SVGReader::LANG_PREFIX_MATCH = 1

Definition at line 40 of file SVGReader.php.


The documentation for this class was generated from the following file: