Skip to content

MarcelBolten/go-noto-elabftw

 
 

Repository files navigation

Go Noto eLabFTW

eLabFTW fonts

Noto Fonts go eLabFTW! For PDF creation in eLabFTW via mPDF we want to avoid reduantand glyphes as much as possible. Download pan-Unicode, Noto Fonts merged according to the languages supported in the eLabFTW front-end.

See caveats too.

Download

If you simply want to use the fonts, go to Releases page and download what you need.

Development builds are available from GitHub Actions page. Click on any workflow with green checkmark ✅ (pipeline passed) and under "Artifacts", download "eLabFTWNotoFonts.zip" (login required).

NOTE: Even if there are no regular commits to this repo, the CI pipeline builds new Go Noto eLabFTW fonts weekly, pulling the latest Noto Fonts from upstream (using a scheduled cron). So, download the "Artifacts" from the "Actions" page to get the best features and bug fixes from Noto Fonts.

Build

If you want to build the fonts yourself, create a virtual environment (venv) and run the script:

python -m venv venv_fonty
source venv_fonty/bin/activate
./scripts/eLab_fonts.sh
deactivate

or start the provided docker container via ./start_docker.sh and then run ./scripts/eLab_fonts.sh inside the container.

Font generation can take a few minutes, depending on your computer's capabilities.

Each script is designed to be reentrant, so you can run it multiple times without altering the working state of the repository or downloading stuff again and again.

Dependencies

fonttools is automatically fetched and used. The main programs we use are pyftmerge, pyftsubset and ttx.

fontforge is automatically added to the docker image and used to scale Noto Emoji (monochrome) from 2048 to 1000 units per em (UPM) so it can be merged with the other fonts.

Coverage

  • eLabFTW Noto -- is split into two files, eLabFTW Noto A and eLabFTW Noto B, to cover scripts that were supported by eLabFTW before the use of Noto Fonts.

    eLabFTW Noto A covers Latin-Greek-Cyrillic, the Unihan Core 2020 (about 20000 codepoints), Math, Symbols, and Emojis.

    eLabFTW Noto B is used to support additional CJK glyphs beyond the Unihan Core 2020.

  • Go Noto Ancient -- combines 70+ Noto Fonts of ancient, historical or liturgical scripts which are not used widely today. This font is probably useful for research or scholarly purposes or language enthusiasts. This font does not support any CJK.

The exact fonts which are combined can be found in the source code.

Font Statistics

Font statistics are collected in tsv format (tab separated value) by the CI pipeline in every run and can be downloaded in build Artifacts.

Statistics below correspond to release v0.1.

eLabFTW Noto Font Characters Glyphs
eLabFTWNotoA.ttf 43751 65480
eLabFTWNotoB.ttf 13425 15116
eLabFTWNotoAncient.ttf 19339 34793

Note that eLabFTWNotoA includes statistics of:

Upstream font Characters Glyphs
Noto Sans 2965 3884
Noto Sans Math 2919 2934
Noto Sans Symbols 840 846
Noto Sans Symbols 2 2641 2660
Noto Sans Emoji 1489 1887
Total 10854 12211

Caveats

  1. eLabFTW Noto is split into two files, A and B, as there are too many codepoints and glyphs for a single .ttf file. However, the PDF generation in eLabFTW is done with mpdf and file B can easily be searched for codepoints and glyphs missing in file A.
  2. Vertical text layout is not supported for CJK, Dogra, Nandinagari, Nüshu and Tangut, even though the upstream Noto Fonts has the support because fonttools does not support merging with vmtx/vhea.
  3. Duployan has limited glyphs, also to avoid GSUB overflow. Cursive connections, contextual forms, and overlap trees are disabled. Shading and combining marks still work.

License

In the spirit of loka-saṃgraha, the scripts distributed in this git repository (the "Software") are dedicated to the public domain as per "The Unlicense". See LICENSE.txt.

However, the fonts generated by using the Software are licensed under the SIL Open Font License, Version 1.1, as required by the upstream Noto Fonts Project.

Others

FontTools package comes with nice utilities ttx (ttf to xml and back), pyftsubset (create font with subset of given font) and pyftmerge (merging fonts, the workhorse of this repo).

libharfbuzz-bin offers CLI utilities hb-view and hb-shape which are useful for visualising rendered characters.

otfinfo gives useful info about glyphs, codepoints, scripts and more.

About

Noto fonts for eLabFTW PDF creation!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 87.3%
  • Python 11.8%
  • Dockerfile 0.9%