MCPcopy Create free account
hub / github.com/PageBot/PageBot / __init__

Method __init__

Lib/pagebot/elements/variablefonts/variablecube2.py:36–62  ·  view source on GitHub ↗
(self, font, point=None, parent=None, style=None,
                 name=None, captionStyle=None, caption=None,
                 location=None, dimensions=None,
                 clipRect=None, mask=None, imo=None, **kwargs)

Source from the content-addressed store, hash-verified

34 # Initialize the default behavior tags as different from Element.
35
36 def __init__(self, font, point=None, parent=None, style=None,
37 name=None, captionStyle=None, caption=None,
38 location=None, dimensions=None,
39 clipRect=None, mask=None, imo=None, **kwargs):
40 Element.__init__(self, point=point, parent=parent, style=style,
41 name=name, **kwargs)
42
43 self.vfFont = font
44 self.style = makeStyle(style, **kwargs) # Combine self.style from
45 # Try to figure out the requested dimensions if the element display per axes.
46 if dimensions is None:
47 dimensions = dict(wght=5, wdth=5, opsz=5)
48 self.dimensions = dimensions
49 # Each element should check at this point if the minimum set of style values
50 # are set and if their values are valid.
51 assert self.w is not None and self.h is not None # Make sure that these are defined.
52 # Make sure that this is a formatted string. Otherwise create it with the current style.
53 # Note that in case there is potential clash in the double usage of fill and stroke.
54
55 # FIXME: Review this: the 's' variable below is undefined.
56 #self.glyphNames = s or 'e'
57 self.glyphNames = 'e'
58
59 # Store the external location, to allow other axis values to be set.
60 if location is None:
61 location = {}
62 self.location = copy(location)
63
64 def draw(self, view, origin):
65 c = self.doc.context

Callers

nothing calls this directly

Calls 1

makeStyleFunction · 0.90

Tested by

no test coverage detected