Add build, deploy and test sources
This commit is contained in:
1 parent
b962581812
commit
3d1a08f230
259 files changed
+15273
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Check how the padded labels measure up (and why the tag column drifts)."""
|
||||
import re
|
||||
from PIL import ImageFont
|
||||
|
||||
CFG = '/path/to/pf/ParavisGrub/grub.cfg'
|
||||
font = ImageFont.truetype('/tmp/Paravis.ttf', 18)
|
||||
|
||||
for line in open(CFG, encoding='utf-8'):
|
||||
m = re.match(r'\s*menuentry "(.+?)" --hotkey=(\S+)', line)
|
||||
if not m:
|
||||
continue
|
||||
label, hk = m.group(1), m.group(2)
|
||||
w_all = font.getlength(label)
|
||||
stripped = label.rstrip()
|
||||
w_txt = font.getlength(stripped)
|
||||
tag = re.search(r'\((\w+)\)$', stripped)
|
||||
body = stripped[:tag.start()] if tag else stripped
|
||||
w_body = font.getlength(body)
|
||||
print('hk=%-2s total=%6.1f body=%6.1f tagstarts=%6.1f spaces=%2d %r' % (
|
||||
hk, w_all, w_body, w_body, len(label) - len(stripped), stripped[:40]))
|
||||
Reference in new issue
Block a user