All Projects → LingDong- → tk-fangsong-font

LingDong- / tk-fangsong-font

Licence: other
剔骨仿宋: Experimental Fang Song style Chinese font

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tk-fangsong-font

LxgwNewClearGothic
A Simplified Chinese sans-serif font derived from IPAex Gothic. 一款衍生于「IPAexゴシック」的简体中文黑体字型。
Stars: ✭ 203 (+118.28%)
Mutual labels:  font, typeface
farro
Farro is an artsy, four-weighted, display typeface that has a peculiar personality flowing through its European humanist silhouette.
Stars: ✭ 26 (-72.04%)
Mutual labels:  font, typeface
Playfair Display
Playfair Display is an Open Source typeface family for display and titling use.
Stars: ✭ 237 (+154.84%)
Mutual labels:  font, typeface
Optician Sans
Typeface based on the historical eye charts and optotypes used by opticians world wide.
Stars: ✭ 203 (+118.28%)
Mutual labels:  font, typeface
system-fonts
Which fonts can I use?
Stars: ✭ 29 (-68.82%)
Mutual labels:  font, typeface
Hack
A typeface designed for source code
Stars: ✭ 14,543 (+15537.63%)
Mutual labels:  font, typeface
perplexed
OTF monospace typeface, a derivative of IBM Plex Mono with Powerline glyphs added
Stars: ✭ 23 (-75.27%)
Mutual labels:  font, typeface
San Francisco Family
All the fonts in San Francisco family font, developed by Apple. Including new SF Camera font from iOS 13!
Stars: ✭ 141 (+51.61%)
Mutual labels:  font, typeface
Hauora-Sans
Neo-grotesque sans-serif font originally designed for an open-sourced health research project
Stars: ✭ 83 (-10.75%)
Mutual labels:  font, typeface
yaldevi-font
A Font family supporting Sinhala, Tamil and Latin.
Stars: ✭ 14 (-84.95%)
Mutual labels:  font, typeface
Techna Sans
Sharp, geometric typeface
Stars: ✭ 189 (+103.23%)
Mutual labels:  font, typeface
basement-grotesque
The basement grotesque typeface.
Stars: ✭ 219 (+135.48%)
Mutual labels:  font, typeface
Inter
The Inter font family
Stars: ✭ 13,303 (+14204.3%)
Mutual labels:  font, typeface
Typefaces
NPM packages for Open Source typefaces
Stars: ✭ 2,581 (+2675.27%)
Mutual labels:  font, typeface
Iosevka
Versatile typeface for code, from code.
Stars: ✭ 13,137 (+14025.81%)
Mutual labels:  font, typeface
Urbanist
Urbanist is a low-contrast, geometric sans-serif inspired by Modernist design and typography.
Stars: ✭ 374 (+302.15%)
Mutual labels:  font, typeface
Times New Bastard
It's Times New Roman but every seventh letter is jarringly sans serif
Stars: ✭ 130 (+39.78%)
Mutual labels:  font, typeface
Plusjakartasans
+Jakarta Sans is a open-source fonts. Designed for Jakarta "City of collaboration" program in 2020.
Stars: ✭ 136 (+46.24%)
Mutual labels:  font, typeface
alt-hack
A stylistic alternate glyph library for the Hack typeface
Stars: ✭ 85 (-8.6%)
Mutual labels:  font, typeface
helmet
Neo-grotesque typeface
Stars: ✭ 133 (+43.01%)
Mutual labels:  font, typeface

An experimental Fang Song style Chinese font generated with skeleton-tracing and pix2pix, with glyphs based on cwTeXFangSong. The font is optimised for vertical typesetting. Below is a sample:

The font contains roughly 13,000 glyphs, mostly for traditional Chinese.

I created the font for one of my own projects. The font is admittedly not perfect, but nevertheless have many ineteresting features; therefore I am sharing the font file and programs used to generate it.

Download

Download the font directly at dist/tkFangSong.ttf.

The name of the font is 剔骨仿宋 (thek-kwot-fang-song, So named because the algorithm that created it resembles "deboning"). It is licensed under SIL open font license. If you wish to credit the author, you might use my name 黃令東/黄令东, or the romanization "Lingdong Huang".

Features

The font builds on the elegant shapes from cwTeXFangSong to add more hand-made look and feel reminiscent of the aesthetics of old woodblock printed books.

The font has a wider proportion compared to the original cwTeXFangSong, and is further widened towards the bottom, to accentuate the finishing strokes. The "center of mass" is also moved downwards:

Above right is a visualization of the base function used to warp the skeleton.

The height of a glyph is additionally tweaked based on its vertical complexity, computed with Sobel operator and taking the max of each pixel row.

Many fonts are optimized for horizontal typesetting, and as such, when arranged vertically, the center of mass shifts left and right, giving a jagged look. This font attempts to solve the problem by computing centroids (via image moments) and aligning them.

The font has rich textures. Some of them are artifacts produced by pix2pix network; others are fine-tuned noises delibrately added.

It is to be noted that, as an automated process, it doesn't always produce optimal results; some characters might end up looking ugly, or use the wrong caligraphic movement for certain strokes; For some caligraphers, some strokes might appear too "weak" to their tastes.

Process

The medial axis (skeleton) is computed for each raster rendering of the glyphs in the original font. (The resultant hershey font can be found at ./dist/CWFS64J.HF.TXT)

Pairs of images: the original rendering vs the skeletons are sent to pix2pix for training. pix2pix learns the correspondance and becomes capable of turning skeletons to glyphs.

New skeletons are generated by warping the originals according to my (questionable) taste.

All the new skeletons are fed into the trained network to obtain the new glyphs. The new glyphs are warped in structure, but the weight and shape of the strokes still look legit.

Some post-processing is applied, and potrace is used to re-vectorize the glyphs. Finally, fontforge is used to create a TTF file.

Building the font

Note that to use the font, you can simply download it here. This sections is for reproducing the results from scratch.

The scripts used to build the font are included in the workflow/ folder. Note that making the font is a quite involved process (especially the part of training the neural net). You might also need to modify the scripts to fit your system/folder configuration, but here are some rough steps:

  • Get OpenCV, tensorflow<=1.13.1, numpy and friends
  • First install swig version of skeleton-tracing for python, then obtain cwTeXFangSong from here.
  • Run skel.py > CWFS64.HF.TXT, then join.py > CWFS64J.HF.TXT
  • Modify pairs.py to read CWFS64J.HF.TXT and output to a folder you will create.
  • Download pix2pix-tensorflow and train on the images created in the previous step. (Good luck getting a prehistoric tensorflow project running, you'll need it. Once you do it's pretty straightforward, follow their README)
  • I trained 40K steps on 1.3K images, afterwhich the quality didn't seem to improve much, your mileage might vary.
  • Run warp.py > CWFS64W3.HF.TXT. Modify pairs.py to read from it, and create an output folder like before. Run pairs.py.
  • Evaluate the new image pairs with pix2pix. Edit any of the images that have too much defect with Photoshop or software of your choice. Put the edited ones in a separated folder, say retouched/.
  • Modify refine.py to read from the images and retouched images folders, create an output folder fine/ for it, and run the script.
  • Download potrace, make it runnable from commandline, and run trace_all.py.
  • Run forgefont.py to create a TTF from SVGs generated in the previous step.
  • Done! You can also preview the glyphs with preview.py > index.html, or preview the skeleton with preview_hf.py > index.html.

A PDF containing all the glyphs can be found here. If you find this font not bad, you might also enjoy qiji-font, a more authentic reproduction of a historical typeface.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].