Qiji-font (齊伋體) is:
- A Ming typeface;
- Extracted from Ming Dynasty woodblock printed books (凌閔刻本);
- Using semi-automatic computer vision and OCR;
- Open source;
- A work in progress;
- Named in honour of 閔齊伋, 16th century printer;
- Intended to be used with wenyan-lang, the Classical Chinese programming language.
📢 聲明:敝字體近日頗見流傳於網絡,然皆訛作“‘凌’东齐伋体”。鄙人名令東,字體名齊伋;強欲冠後以前者,亦以“令東齊伋體”為宜,望周知。🤦♂️
- See Releases page.
| Unique Glyphs | Covered Characters* | Books Scanned |
|---|---|---|
| 4569 | 5916 | 李長吉歌詩 / 淮南鴻烈解 |
* Simplified forms fall back to traditional forms, more common traditional variants fall back to less common variant forms.
Step I: Download high resolution PDFs (from shuge.org) and split pages into images.
Step II: Manually lay a grid on top of each page to generate bounding boxes for characters (potentially replacable by an automatic corner-detection algorithm).
Step III: Generate a low-poly mask for each character on the grid, and save the thumbnails (using OpenCV). First, red channel is subtracted from the grayscale, in order to clean the annotations printed in red ink. Next, the image is thresholded and fed into contour-tracing algorithm. A metric is then used to discard shapes that are unlikely to be part of the character in interest. (This step does not produce the final glyph, only a quick-and-dirty extraction for intermediate processing.)
Step IV: Feed each thumbnail one by one into neural-net Chinese OCR to recognize the characters (currently using chineseocr/darknet-ocr, low detection rate, mediocre accuracy, very slow on CPU, looking for better alternatives).
Step V: Manually judge output of OCR: pick the best-looking instance of a given character, and flag incorrectly recognized characters.
Step VI: For the final character set, automatically generate fine raster rendering of each character. Each character is placed at its “visual” center by cumulatively counting pixels from left and right, as well as top and bottom, so that the “weight” of the character is on the centerlines, as opposed to centering the bounding box. Two thresholding methods are used, the global threshold is dilated and acts as a mask to the adaptive threshold, thus preserving details while blocking out surrounding boogers.
Step VII: Raster-to-vector tracing software potrace is used to convert the raster rendrings into SVG’s. FontForge’s python library is used to generate the final font file. Done!
As the number of characters grow, the above procedure is going to be less and less efficient, since new, previously unseen characters obtainable from each book processed are going to be rarer and rarer. An alternative method which involves clicking only on unseen characters to pick them out is under construction.
- Character sizes are sometimes inconsistent. Undergoing manual tweaking.
Requirements:
- Python 3
- OpenCV Python (
pip3 install opencv-python) - FontForge Python library (included in
brew install fontforge) - Chinese OCR (e.g. chineseocr/darknet-ocr)
- Raster-to-vector tracer (e.g. potrace)
The main code is contained in /workflow, and corresponds to the steps described above. Documentation for the code is yet to be done (soon), so feel free to inquire if interested. As you might have noticed, there is a ton of work involved in making a Chinese font, so contribution is very much welcome 🙂
Sheet of all unique glyphs sorted by unicode entry point, click to enlarge. (this is lossy JPEG, for full PNG, check here, for SVG, run node workflow/make_sheet.js)
数据统计
相关导航
萌典共收錄十六萬筆臺灣華語、兩萬筆臺灣台語、一萬四千筆臺灣客語條目,並支援「自動完成」功能及「%_ *? ^.$」等萬用字元。定義裡的每個字詞都可以點擊連到說明。源碼、其他平台版本、API 及原始資料等,均可在 GitHub 取得。
BookReader
Internet Archive BookReader 用于在线查看 Internet Archive 中的书籍,也可用于查看其他书籍。
文言 wenyan-lang
文言文編程語言 A programming language for the ancient Chinese.
文言 / wenyan-lang
文言(或称wenyan)是一种深奥的编程语言,它严格遵循中国古典文学的语法和语调。此外,文言的字母表仅包含繁体汉字和引语,因此保证古代中国人能够阅读。您也可以在在线编辑器「」上试用,下载编译器,或查看源代码。
Dezoomify
Dezoomify可以从在线可缩放图像界面提取完整的高分辨率图像。它支持来自多个不同网站的多种可缩放图像工具(参见下方列表)。它以可缩放图像的 URL 作为输入,并输出可供下载的图像(右键单击图像,然后选择“图像另存为... ”)。
Universal Viewer
Universal Viewer (UV) 是一个由社区开发的开源项目。我们的使命是帮助您与世界分享您的内容。
wenyan-book《文言陰符》
文言陰符 An Introduction to Programming in Wenyan Language
wenyan《文言陰符》
An Introduction to Programming in Wenyan Language












