OpenType font table having the tag 'head' and containing certain header information for the font, including its bold and/or italic style.
| 236 | |
| 237 | |
| 238 | class _HeadTable(_BaseTable): |
| 239 | """ |
| 240 | OpenType font table having the tag 'head' and containing certain header |
| 241 | information for the font, including its bold and/or italic style. |
| 242 | """ |
| 243 | |
| 244 | def __init__(self, tag, stream, offset, length): |
| 245 | super(_HeadTable, self).__init__(tag, stream, offset, length) |
| 246 | |
| 247 | @property |
| 248 | def is_bold(self): |
| 249 | """ |
| 250 | |True| if this font is marked as having emboldened characters. |
| 251 | """ |
| 252 | return bool(self._macStyle & 1) |
| 253 | |
| 254 | @property |
| 255 | def is_italic(self): |
| 256 | """ |
| 257 | |True| if this font is marked as having italicized characters. |
| 258 | """ |
| 259 | return bool(self._macStyle & 2) |
| 260 | |
| 261 | @lazyproperty |
| 262 | def _fields(self): |
| 263 | """ |
| 264 | A 17-tuple containing the fields in this table. |
| 265 | """ |
| 266 | return self._stream.read_fields(">4s4sLLHHqqhhhhHHHHH", self._offset) |
| 267 | |
| 268 | @property |
| 269 | def _macStyle(self): |
| 270 | """ |
| 271 | The unsigned short value of the 'macStyle' field in this head table. |
| 272 | """ |
| 273 | return self._fields[12] |
| 274 | |
| 275 | |
| 276 | class _NameTable(_BaseTable): |
no outgoing calls
searching dependent graphs…