Skip to content

Instantly share code, notes, and snippets.

@xiaopc
xiaopc / draw_table.py
Last active February 21, 2024 09:34
Draw a table using only Pillow
from PIL import Image, ImageFont, ImageDraw
from collections import namedtuple
def position_tuple(*args):
Position = namedtuple('Position', ['top', 'right', 'bottom', 'left'])
if len(args) == 0:
return Position(0, 0, 0, 0)
elif len(args) == 1:
return Position(args[0], args[0], args[0], args[0])
@oxplot
oxplot / svglinkify.md
Last active November 25, 2022 11:27
Add hyperlinks to PDFs created by Inkscape