|
1
|
|
|
<?php |
|
2
|
|
|
namespace nstdio\svg\font; |
|
3
|
|
|
|
|
4
|
|
|
/** |
|
5
|
|
|
* Class FontFace |
|
6
|
|
|
* The ‘font-face’ element corresponds directly to the @font-face facility in CSS2 ([CSS2], section 15.3.1). It can be |
|
7
|
|
|
* used to describe the characteristics of any font, SVG font or otherwise. |
|
8
|
|
|
* |
|
9
|
|
|
* When used to describe the characteristics of an SVG font contained within the same document, it is recommended that |
|
10
|
|
|
* the ‘font-face’ element be a child of the ‘font’ element it is describing so that the ‘font’ element can be |
|
11
|
|
|
* self-contained and fully-described. In this case, any ‘font-face-src’ elements within the ‘font-face’ element are |
|
12
|
|
|
* ignored as it is assumed that the ‘font-face’ element is describing the characteristics of its parent ‘font’ |
|
13
|
|
|
* element. |
|
14
|
|
|
* |
|
15
|
|
|
* @property string fontFamily = "<string>" Same syntax and semantics as the ‘font-family’ descriptor |
|
16
|
|
|
* within an @font-face rule. |
|
17
|
|
|
* @property string fontStyle = "all | [ normal | italic | oblique] [, [normal | italic | oblique]]*" |
|
18
|
|
|
* Same syntax and semantics as the ‘font-style’ descriptor within an @font-face rule. The style of a font. |
|
19
|
|
|
* Takes on the same values as the ‘font-style’ property, except that a comma-separated list is permitted. If |
|
20
|
|
|
* the attribute is not specified, the effect is as if a value of 'all' were specified. |
|
21
|
|
|
* @property string fontVariant = "[normal | small-caps] [,[normal | small-caps]]*" Same syntax and |
|
22
|
|
|
* semantics as the ‘font-variant’ descriptor within an @font-face rule. Indication of whether this face is |
|
23
|
|
|
* the small-caps variant of a font. Takes on the same values as the ‘font-variant’ property, except that a |
|
24
|
|
|
* comma-separated list is permitted. If the attribute is not specified, the effect is as if a value of |
|
25
|
|
|
* 'normal' were specified. |
|
26
|
|
|
* @property string|int fontWeight = "all | [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 |
|
27
|
|
|
* | 900] [, [normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]]*" Same syntax and |
|
28
|
|
|
* semantics as the ‘font-weight’ descriptor within an @font-face rule. The weight of a face relative to |
|
29
|
|
|
* others in the same font family. Takes on the same values as the ‘font-weight’ property with three |
|
30
|
|
|
* exceptions: relative keywords (bolder, lighter) are not permitted a comma-separated list of values is |
|
31
|
|
|
* permitted, for fonts that contain multiple weights an additional keyword, 'all', is permitted, which means |
|
32
|
|
|
* that the font will match for all possible weights; either because it contains multiple weights, or because |
|
33
|
|
|
* that face only has a single weight. If the attribute is not specified, the effect is as if a value of |
|
34
|
|
|
* 'all' were specified. |
|
35
|
|
|
* @property string fontStretch = "all | [ normal | ultra-condensed | extra-condensed | condensed | |
|
36
|
|
|
* semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded] [, [ normal | ultra-condensed |
|
37
|
|
|
* | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | |
|
38
|
|
|
* ultra-expanded] ]*" Same syntax and semantics as the ‘font-stretch’ descriptor within an @font-face rule. |
|
39
|
|
|
* Indication of the condensed or expanded nature of the face relative to others in the same font family. |
|
40
|
|
|
* Takes on the same values as the ‘font-stretch’ property except that: relative keywords (wider, narrower) |
|
41
|
|
|
* are not permitted a comma-separated list is permitted the keyword 'all' is permitted If the attribute is |
|
42
|
|
|
* not specified, the effect is as if a value of 'normal' were specified. |
|
43
|
|
|
* @property string fontSize = "<string>" Same syntax and semantics as the ‘font-size’ descriptor |
|
44
|
|
|
* within an @font-face rule. |
|
45
|
|
|
* @property string unicodeRange = "<urange> [, <urange>]*" Same syntax and semantics as the |
|
46
|
|
|
* ‘unicode-range’ descriptor within an @font-face rule. The range of ISO 10646 characters [UNICODE] possibly |
|
47
|
|
|
* covered by the glyphs in the font. Except for any additional information provided in this specification, |
|
48
|
|
|
* the normative definition of the attribute is in CSS2 ([CSS2], section 15.3.3). If the attribute is not |
|
49
|
|
|
* specified, the effect is as if a value of 'U+0-10FFFF' were specified. |
|
50
|
|
|
* @property string unitsPerEm = "<number>" Same syntax and semantics as the ‘units-per-em’ descriptor |
|
51
|
|
|
* within an @font-face rule. The number of coordinate units on the em square, the size of the design grid on |
|
52
|
|
|
* which glyphs are laid out. This value is almost always necessary as nearly every other attribute requires |
|
53
|
|
|
* the definition of a design grid. If the attribute is not specified, the effect is as if a value of '1000' |
|
54
|
|
|
* were specified. |
|
55
|
|
|
* @property int panose -1 = "[<integer>]{10}" Same syntax and semantics as the ‘panose-1’ |
|
56
|
|
|
* descriptor within an @font-face rule. The Panose-1 number, consisting of ten decimal integers, separated |
|
57
|
|
|
* by whitespace. Except for any additional information provided in this specification, the normative |
|
58
|
|
|
* definition of the attribute is in CSS2 ([CSS2], section 15.3.6). If the attribute is not specified, the |
|
59
|
|
|
* effect is as if a value of '0 0 0 0 0 0 0 0 0 0' were specified. |
|
60
|
|
|
* @property float stemv = "<number>" Same syntax and semantics as the ‘stemv’ descriptor within |
|
61
|
|
|
* an @font-face rule. |
|
62
|
|
|
* @property float stemh = "<number>" Same syntax and semantics as the ‘stemh’ descriptor within |
|
63
|
|
|
* an @font-face rule. |
|
64
|
|
|
* @property float slope = "<number>" Same syntax and semantics as the ‘slope’ descriptor within |
|
65
|
|
|
* an @font-face rule. The vertical stroke angle of the font. Except for any additional information provided |
|
66
|
|
|
* in this specification, the normative definition of the attribute is in CSS2 ([CSS2], section 15.3.6). If |
|
67
|
|
|
* the attribute is not specified, the effect is as if a value of '0' were specified. |
|
68
|
|
|
* @property float capHeight = "<number>" Same syntax and semantics as the ‘cap-height’ descriptor |
|
69
|
|
|
* within an @font-face rule. The height of uppercase glyphs in the font within the font coordinate system. |
|
70
|
|
|
* @property float xHeight = "<number>" Same syntax and semantics as the ‘x-height’ descriptor |
|
71
|
|
|
* within an @font-face rule. The height of lowercase glyphs in the font within the font coordinate system. |
|
72
|
|
|
* @property float accentHeight = "<number>" The distance from the origin to the top of accent |
|
73
|
|
|
* characters, measured by a distance within the font coordinate system. If the attribute is not specified, |
|
74
|
|
|
* the effect is as if the attribute were set to the value of the ‘ascent’ attribute. |
|
75
|
|
|
* @property float ascent = "<number>" Same syntax and semantics as the ‘ascent’ descriptor within |
|
76
|
|
|
* an @font-face rule. The maximum unaccented height of the font within the font coordinate system. If the |
|
77
|
|
|
* attribute is not specified, the effect is as if the attribute were set to the difference between the |
|
78
|
|
|
* ‘units-per-em’ value and the ‘vert-origin-y’ value for the corresponding font. |
|
79
|
|
|
* @property float descent = "<number>" Same syntax and semantics as the ‘descent’ descriptor |
|
80
|
|
|
* within an @font-face rule. The maximum unaccented depth of the font within the font coordinate system. If |
|
81
|
|
|
* the attribute is not specified, the effect is as if the attribute were set to the ‘vert-origin-y’ value |
|
82
|
|
|
* for the corresponding font. |
|
83
|
|
|
* @property string widths = "<string>" Same syntax and semantics as the ‘widths’ descriptor within |
|
84
|
|
|
* an @font-face rule. |
|
85
|
|
|
* @property string bbox = "<string>" Same syntax and semantics as the ‘bbox’ descriptor within |
|
86
|
|
|
* an @font-face rule. |
|
87
|
|
|
* @property float ideographic = "<number>" For horizontally oriented glyph layouts, indicates the |
|
88
|
|
|
* alignment coordinate for glyphs to achieve ideographic baseline alignment. The value is an offset in the |
|
89
|
|
|
* font coordinate system. |
|
90
|
|
|
* @property float alphabetic = "<number>" Same syntax and semantics as the ‘baseline’ descriptor |
|
91
|
|
|
* within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for |
|
92
|
|
|
* glyphs to achieve alphabetic baseline alignment. The value is an offset in the font coordinate system. |
|
93
|
|
|
* @property float mathematical = "<number>" Same syntax and semantics as the ‘mathline’ descriptor |
|
94
|
|
|
* within an @font-face rule. For horizontally oriented glyph layouts, indicates the alignment coordinate for |
|
95
|
|
|
* glyphs to achieve mathematical baseline alignment. The value is an offset in the font coordinate system. |
|
96
|
|
|
* @property float hanging = "<number>" For horizontally oriented glyph layouts, indicates the |
|
97
|
|
|
* alignment coordinate for glyphs to achieve hanging baseline alignment. The value is an offset in the font |
|
98
|
|
|
* coordinate system. |
|
99
|
|
|
* @property float vIdeographic = "<number>" For vertically oriented glyph layouts, indicates the |
|
100
|
|
|
* alignment coordinate for glyphs to achieve ideographic baseline alignment. The value is an offset in the |
|
101
|
|
|
* font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute. |
|
102
|
|
|
* @property float vAlphabetic = "<number>" For vertically oriented glyph layouts, indicates the |
|
103
|
|
|
* alignment coordinate for glyphs to achieve alphabetic baseline alignment. The value is an offset in the |
|
104
|
|
|
* font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute. |
|
105
|
|
|
* @property float vMathematical = "<number>" For vertically oriented glyph layouts, indicates the |
|
106
|
|
|
* alignment coordinate for glyphs to achieve mathematical baseline alignment. The value is an offset in the |
|
107
|
|
|
* font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute. |
|
108
|
|
|
* @property float vHanging = "<number>" For vertically oriented glyph layouts, indicates |
|
109
|
|
|
* the alignment coordinate for glyphs to achieve hanging baseline alignment. The value is an offset in the |
|
110
|
|
|
* font coordinate system relative to the glyph-specific ‘vert-origin-x’ attribute. |
|
111
|
|
|
* @property float underlinePosition = "<number>" The ideal position of an underline within the font |
|
112
|
|
|
* coordinate system. |
|
113
|
|
|
* @property float underlineThickness = "<number>" The ideal thickness of an underline, expressed as a length |
|
114
|
|
|
* within the font coordinate system. |
|
115
|
|
|
* @property float strikethroughPosition = "<number>" The ideal position of a strike-through within the font |
|
116
|
|
|
* coordinate system. |
|
117
|
|
|
* @property float strikethroughThickness = "<number>" The ideal thickness of a strike-through, expressed as a |
|
118
|
|
|
* length within the font coordinate system. |
|
119
|
|
|
* @property float overlinePosition = "<number>" The ideal position of an overline within the font |
|
120
|
|
|
* coordinate system. |
|
121
|
|
|
* @property float overlineThickness = "<number>" The ideal thickness of an overline, expressed as a length |
|
122
|
|
|
* within the font coordinate system. |
|
123
|
|
|
* @package nstdio\svg\font |
|
124
|
|
|
* @author Edgar Asatryan <[email protected]> |
|
125
|
|
|
*/ |
|
126
|
|
|
class FontFace extends BaseFont |
|
127
|
|
|
{ |
|
128
|
|
|
/** |
|
129
|
|
|
* @inheritdoc |
|
130
|
|
|
*/ |
|
131
|
1 |
|
public function getName() |
|
132
|
|
|
{ |
|
133
|
1 |
|
return "font-face"; |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
} |