-
Notifications
You must be signed in to change notification settings - Fork 0
/
logo.py
38 lines (32 loc) · 1.15 KB
/
logo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import collections
scale = 128
stroke_width = 48
Point = collections.namedtuple('Point', ['x', 'y'])
origin = Point(0, stroke_width/2)
backwards_s = ' '.join([
f'M{origin.x},{origin.y}',
f'l {2*scale + stroke_width/2},0',
f'a{scale},{scale} 0 0,1 0,{2 * scale}',
f'l -{scale},0',
f'a{scale},{scale} 0 0,0 0,{2 * scale}',
f'l {2*scale + stroke_width/2},0'])
vertical_line = f'M{origin.x},{origin.y} m{1.5*scale + stroke_width/2},{scale} l 0,{2 * scale}'
path_d = f'{backwards_s} {vertical_line}'
symbol_svg = f'''<?xml version="1.0" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1" style="display:none">
<symbol id="pcattori-logo" viewBox="0 0 {3*scale + stroke_width} {4*scale + stroke_width}">
<path d="{path_d}" fill="none" stroke="black" stroke-width="{stroke_width}"/>
</symbol>
</svg>
'''
svg = f'''<?xml version="1.0" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 {3*scale + stroke_width} {4*scale + stroke_width}"
version="1.1">
<path d="{path_d}" fill="none" stroke="black" stroke-width="{stroke_width}"/>
</svg>
'''
print(svg)