1
|
|
|
<?php |
2
|
|
|
namespace nstdio\svg\text; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* Class Glyph |
6
|
|
|
* The ‘glyph’ element defines the graphics for a given glyph. The coordinate system for the glyph is defined by the |
7
|
|
|
* various attributes in the ‘font’ element. |
8
|
|
|
* The graphics that make up the ‘glyph’ can be a single path data specification within the ‘d’ attribute, arbitrary |
9
|
|
|
* SVG as content within the ‘glyph’, or both. These two alternatives are processed differently. |
10
|
|
|
* |
11
|
|
|
* @link https://www.w3.org/TR/SVG11/fonts.html#GlyphElement |
12
|
|
|
* @property string unicode = "<string>" One or more Unicode characters indicating the sequence of Unicode |
13
|
|
|
* characters which corresponds to this glyph. If a character is provided, then this glyph corresponds to the |
14
|
|
|
* given Unicode character. If multiple characters are provided, then this glyph corresponds to the given |
15
|
|
|
* sequence of Unicode characters. One use of a sequence of characters is ligatures. For example, if |
16
|
|
|
* unicode="ffl", then the given glyph will be used to render the sequence of characters "f", "f", and "l". |
17
|
|
|
* It is often useful to refer to characters using XML character references expressed in hexadecimal notation |
18
|
|
|
* or decimal notation. For example, unicode="ffl" could be expressed as XML character references in |
19
|
|
|
* hexadecimal notation as unicode="ffl" or in decimal notation as |
20
|
|
|
* unicode="ffl". The ‘unicode’ attribute contributes to the process for deciding which |
21
|
|
|
* glyph(s) are used to represent which character(s). See glyph selection rules. If the |
22
|
|
|
* ‘unicode’ attribute is not provided for a given ‘glyph’, then the only way to use this glyph is via an |
23
|
|
|
* ‘altGlyph’ reference. |
24
|
|
|
* @property string glyphName = "<name> [, <name> ]* " A name for the glyph. It is recommended that glyph names |
25
|
|
|
* be unique within a font. The glyph names can be used in situations where Unicode character numbers do not |
26
|
|
|
* provide sufficient information to access the correct glyph, such as when there are multiple glyphs per |
27
|
|
|
* Unicode character. The glyph names can be referenced in kerning definitions. |
28
|
|
|
* @property string d = "path data" The definition of the outline of a glyph, using the same syntax as for |
29
|
|
|
* the |
30
|
|
|
* ‘d’ attribute on a ‘path’ element. See Path data. See below for a discussion of this attribute. |
31
|
|
|
* @property string orientation = "h | v" Indicates that the given glyph is only to be used for a particular |
32
|
|
|
* inline-progression-direction (i.e., horizontal or vertical). If the attribute is not specified, then the |
33
|
|
|
* glyph can be used in all cases (i.e., both horizontal and vertical inline-progression-direction). |
34
|
|
|
* @property string arabicForm = "initial | medial | terminal | isolated" For Arabic glyphs, indicates which of |
35
|
|
|
* the four possible forms this glyph represents. |
36
|
|
|
* @property string lang = "%LanguageCodes;" The attribute value is a comma-separated list of language names as |
37
|
|
|
* defined in BCP 47 {@link http://www.ietf.org/rfc/bcp/bcp47.txt}. The glyph can be used if the ‘xml:lang’ |
38
|
|
|
* attribute exactly matches one of the languages given in the value of this parameter, or if the ‘xml:lang’ |
39
|
|
|
* attribute exactly equals a prefix of one of the languages given in the value of this parameter such that |
40
|
|
|
* the first tag character following the prefix is "-". |
41
|
|
|
* @property float horizAdvX = "<number>" The horizontal advance after rendering the glyph in horizontal |
42
|
|
|
* orientation. If the attribute is not specified, the effect is as if the attribute were set to the value of |
43
|
|
|
* the font's ‘horiz-adv-x’ attribute. Glyph widths are required to be non-negative, even if the glyph is |
44
|
|
|
* typically rendered right-to-left, as in Hebrew and Arabic scripts. |
45
|
|
|
* @property float vertOriginX = "<number>" The X-coordinate in the font coordinate system of the origin of |
46
|
|
|
* the glyph to be used when drawing vertically oriented text. If the attribute is not specified, the effect |
47
|
|
|
* is as if the attribute were set to the value of the font's ‘vert-origin-x’ attribute. |
48
|
|
|
* @property float vertOriginY = "<number>" The Y-coordinate in the font coordinate system of the origin of a glyph to |
49
|
|
|
* be used when drawing vertically oriented text. If the attribute is not specified, the effect is as if the |
50
|
|
|
* attribute were set to the value of the font's ‘vert-origin-y’ attribute. |
51
|
|
|
* @property float vertAdvY = "<number>" The vertical advance after rendering a glyph in vertical orientation. If |
52
|
|
|
* the attribute is not specified, the effect is as if the attribute were set to the value of the font's |
53
|
|
|
* ‘vert-adv-y’ attribute. |
54
|
|
|
* @package nstdio\svg\text |
55
|
|
|
* @author Edgar Asatryan <[email protected]> |
56
|
|
|
*/ |
57
|
|
|
class Glyph extends BaseText |
58
|
|
|
{ |
59
|
|
|
|
60
|
1 |
|
public function getName() |
61
|
|
|
{ |
62
|
1 |
|
return 'glyph'; |
63
|
|
|
} |
64
|
|
|
} |