Temml icon indicating copy to clipboard operation
Temml copied to clipboard

Noto Sans Math woff2

Open tats-u opened this issue 10 months ago • 6 comments

Temml supports only ttf in Noto Sans Math, but the following package provides woff2 version:

https://www.npmjs.com/package/@fontsource/noto-sans-math

A new Temml-*.css variant is wanted.

.ttf version is nearly 1MB and too fat but .woff2 in the package is only about 220kB.

tats-u avatar Apr 20 '25 14:04 tats-u

In the first place, there should be a Temml-Custom.css, where no font-family is not specified.

tats-u avatar Apr 20 '25 14:04 tats-u

Noto Sans Math … woff2 version

I tried the woff2 version from https://fonts.google.com/noto/specimen/Noto+Sans+Math. The math rendering was dreadful. None of the delimiters stretched. None of the arrows stretched. So I reverted to the ttf version.

I do not expect any web site to ship a 1MB font file. I have included Noto Sans so that Windows users and MacOS users can see what system font math will look like if and when Google makes Noto San Math a part of their operating systems.

there should be a Temml-Custom.css

Temml CSS files are not complex. Feel free to take one, rename it, and customize it to your needs.

ronkok avatar Apr 20 '25 23:04 ronkok

https://fonts.google.com/noto/specimen/Noto+Sans+Math.

I think we can get only a reduced .ttf file (574kB).

I tried converting the original .ttf (992kB) and .otf (487kB) to .woff2 and got 337kB and 293kB. Noto Sans is the only major sans-serif math font and matches the surrounding text (mainly sans-serif).

Feel free to take one, rename it, and customize it to your needs.

It's best to copy the bundled style sheet in the latest Temml to the build directory by using a copy plugin of the bundler (e.g. copy-webpack-plugin, CopyRspackPlugin, or vite-plugin-static-copy). I don't want to manage it in Git by myself.

tats-u avatar Apr 21 '25 10:04 tats-u

c.f. https://github.com/tats-u/docusaurus-plugin-copy-temml-assets

By this plugin Docusaurus users will have only to manage Temml version in package.json / lock file.

tats-u avatar Apr 21 '25 10:04 tats-u

I may as well submit a PR containing Temml-Custom.css.

tats-u avatar Apr 21 '25 10:04 tats-u

I tried converting the original .ttf (992kB) and .otf (487kB) to .woff2 and got 337kB and 293kB.

sudo apt install unzip woff2
wget https://github.com/notofonts/math/releases/download/NotoSansMath-v3.000/NotoSansMath-v3.000.zip
unzip ./NotoSansMath-v3.000.zip
woff2_compress NotoSansMath/full/ttf/NotoSansMath-Regular.ttf
woff2_compress NotoSansMath/full/otf/NotoSansMath-Regular.otf
sha256sum NotoSansMath/full/*/NotoSansMath-Regular.woff2
ls -lh NotoSansMath/full/*/NotoSansMath-Regular.woff2
fb8e98bfd51cbc265e6dd2a98d01f027563a04f046e801543a8bb98ae556c6a4  NotoSansMath/full/otf/NotoSansMath-Regular.woff2
e1df868ca99c3e745b89a042661ff4245c2c342c9c66146f445d1224a79c8f71  NotoSansMath/full/ttf/NotoSansMath-Regular.woff2
-rw-r--r-- 1 tatsu tatsu 293K Apr 22 08:35 NotoSansMath/full/otf/NotoSansMath-Regular.woff2
-rw-r--r-- 1 tatsu tatsu 337K Apr 22 08:36 NotoSansMath/full/ttf/NotoSansMath-Regular.woff2

tats-u avatar Apr 21 '25 23:04 tats-u