Pixel font: Monocraft-based bitmap font with Greek and math symbols #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Our own pixel font, with the Latin, Greek and math coverage the charts and formulas (#18) need, as a bitmap font in the format of parin_kit#141 (PNG sheet + txt).
Base: Monocraft (v4.2.1, OFL-1.1, Minecraft style, 1475 glyphs; there is also a Nerd Fonts-patched build in its releases). Checked:
± × ÷ · − ∞ ∂ ∑ ∫ ≠ → ← ⇒ ⇔ ∀ ∃ ¬ ∧ ∨ ° ‰, superscript and subscript digits.√ ∇ ∏ ∬ ≈ ≡ ≤ ≥ ≪ ≫ ∈ ∪ ∅ ⁿ,ℕ ℤ ℚ ℝ ℂ ℏ ℓ,⟨ ⟩ ⌈ ⌉ ⌊ ⌋ ‖. (√, big brackets and fraction bars are drawn as shapes by the formula renderer anyway, but text needs them too.)tabularDigits = true) so counting numbers don't jitter.Work:
tools/make_font.py(Pillow + fontTools): rasterize the chosen characters of Monocraft at 9 px (fontmode = "1") intoassets/fonts/text.png+text.txt, one sheet per weight, with the baseline and offsets read from the font.ßcomes out like aβ).OFL.txtinassets/fonts/and credit it in the README (the OFL allows changes and embedding, but the changed font must not be called "Monocraft").Until parin_kit#141 lands, keep a small loader in
source/bitmap_font.dwith// TODO: move to parin_kit, see parin_kit#141.Done when: labels, numbers, Greek and the math symbols draw crisp at x2 and x3, the missing glyphs are drawn, and editing the PNG updates the running player.