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

Method __init__

Lib/pagebot/elements/variablefonts/variablecube.py:29–54  ·  view source on GitHub ↗
(self, font, s=None, point=None, style=None, eId=None,
            dimensions=None, location=None, **kwargs)

Source from the content-addressed store, hash-verified

27 """
28
29 def __init__(self, font, s=None, point=None, style=None, eId=None,
30 dimensions=None, location=None, **kwargs):
31 super().__init__()
32 self.font = font
33 #self.eId = eId
34 self.style = makeStyle(style, **kwargs) # Combine self.style from
35
36 # Try to figure out the requested dimensions if the element display per
37 # axes.
38 if dimensions is None:
39 dimensions = dict(wght=4, wdth=6)
40 self.dimensions = dimensions
41
42 # Each element should check at this point if the minimum set of style
43 # values are set and if their values are valid.
44 assert self.w is not None and self.h is not None # Make sure that these are defined.
45
46 # Makes sure that this is a formatted string. Otherwise create it with
47 # the current style. Note that in case there is potential clash in the
48 # double usage of fill and stroke.
49 self.glyphNames = s or 'e'
50
51 # Stores the external location, to allow other axis values to be set.
52 if location is None:
53 location = {}
54 self.location = copy(location)
55
56 def draw(self, view, origin):
57 c = self.doc.context

Callers

nothing calls this directly

Calls 1

makeStyleFunction · 0.90

Tested by

no test coverage detected