diff --git a/gen.py b/gen.py index 948f374..7f5d41b 100755 --- a/gen.py +++ b/gen.py @@ -41,53 +41,41 @@ def char_image(c): index = 4 * char_index(c) return chars.crop((index, 0, index + 3, 5)) -def separator(start, end, width): +def separator(start, width): img = PIL.Image.new("RGB", (width, 9), color=WHITE) for j in range(3, 6): - for i in range(1, width//2 - 30): + for i in range(1, width//2 - 15): if not ((i + j) & 1): img.putpixel((i, j), BLACK) - for i in range(width//2 + 30, width-1): + for i in range(width//2 + 15, width-1): if not ((i + j) & 1): img.putpixel((i, j), BLACK) - x = width//2 - 29 + x = width//2 - 11 for c in "U+{:04X}".format(start): img.paste(char_image(c), (x, 2)) x += 4 - for i in range(width//2 - 2, width//2 + 2): - img.putpixel((i, 4), BLACK) - - x = width//2 + 6 - for c in "U+{:04X}".format(end): - img.paste(char_image(c), (x, 2)) - x += 4 - return img class Block: def __init__(self, path): basename = os.path.basename(path) match = re.search(r'U\+([0-9A-Za-z]{4})', basename) - self.block_start = None - self.block_end = None self.img = PIL.Image.open(path) if match is not None: self.block_start = int(match[1], 16) - self.block_end = self.block_start + 16 * (self.img.height // 9) - 1 - print('{} U+{:04X} - U+{:04X}'.format(basename, self.block_start, - self.block_end)) + print('{} U+{:04X}'.format(basename, self.block_start)) else: print(f'{basename} not a block') def header(self, width): if self.block_start is not None: - return separator(self.block_start, self.block_end, width) + return separator(self.block_start, width) else: return empty_separator(width) diff --git a/uf5x7.png b/uf5x7.png index f8aebdd..0503ee4 100644 Binary files a/uf5x7.png and b/uf5x7.png differ diff --git a/uf8x9.png b/uf8x9.png index 124cb71..5c57c26 100644 Binary files a/uf8x9.png and b/uf8x9.png differ