#!/usr/bin/env python3 # -*- coding: utf-8 -*- """preview_glyphs.py — 从 atlas/font.png + font.idx 抽取若干字符,拼成带标注的接触表 PNG, 用于人工核对图集中字形正确、无漏字。用法: preview_glyphs.py """ import struct import sys from PIL import Image, ImageDraw def load_idx(path): d = open(path, "rb").read() assert d[:4] == b"MFNI", d[:4] depth = d[6] nf = d[7] faces = [] for i in range(nf): fh = d[16 + i * 20:16 + i * 20 + 20] px, px_, py, pw, ph, asc, dsc, gc = struct.unpack("