Pomax / nrGrammar

The Nihongo Resources grammar book: "An Introduction to Japanese; Syntax, Grammar & Language"
334 stars 36 forks source link

Add webfont and script to subset a font. #35

Open Szunti opened 5 years ago

Szunti commented 5 years ago

How about this for #34?

Hanazono font was chosen because for Han Nom:

  1. couldn't find a license
  2. I don't know if it matters but it's a Vietnamese font, as far as I know Hanazono is Japanese

Do you want anything different?

make_woff.py --help
usage: ./make_woff.py conffile

conffile is in JSON format. Example with explanatory comments (don't include
these comments in the JSON file):
{
  // List of files or globs relative to the config file's dir.
  "dataFiles": [
    "../data/pages/en-GB/**/*.txt"
  ],
  // List of individual code points and ranges (list with start an end).
  "excludeCodepoints": [
    [0, 127]
  ],
  // The order of fonts are important, fonts will be checked for every code
  // point until one has a glyph. First element is the input, second is the
  // output.
  "fonts": [
    ["HanaMinA.ttf", "../HanaMinA.woff"],
    ["HanaMinB.ttf", "../HanaMinB.woff"]
  ],
  // Missing characters will be written to this file in utf-8. relative to
  // config file's location
  "missingOutput": "missing.txt",
  // if true, only print which fonts are used and missing characters
  "justCheck": false
}
Pomax commented 5 years ago

Having both PHP and Python as build tools might cause some problems when it comes to adding CI to this, but that can be a later concern. I've left a few comments but overall this looks fine to me. Thank you for helping get this implemented.

Szunti commented 5 years ago

Unless slicing for sections are needed, I think I'm done.