MCPcopy Create free account
hub / github.com/scanny/python-pptx / _HeadTable

Class _HeadTable

src/pptx/text/fonts.py:238–273  ·  view source on GitHub ↗

OpenType font table having the tag 'head' and containing certain header information for the font, including its bold and/or italic style.

Source from the content-addressed store, hash-verified

236
237
238class _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
276class _NameTable(_BaseTable):

Callers 3

bold_fixtureMethod · 0.90
italic_fixtureMethod · 0.90
macStyle_fixtureMethod · 0.90

Calls

no outgoing calls

Tested by 3

bold_fixtureMethod · 0.72
italic_fixtureMethod · 0.72
macStyle_fixtureMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…