This commit allows loading a certain font face from a font collection file such as TTC.
TTC file is very important for CJK fonts. For example, Android includes .ttc font files for CJK characters due to the fact that Chinese/Japanese/Korean share a lot of characters. Without a .ttc file, we need four files (each file takes at least 15 MB) to support all of Japanese/Chinese/Korean characters. The Noto-CJK TTC font file included in Android only takes ~25 MB.
Currently, the stb implementation in NanoVG does not support TTC at all as mentioned in #554. And the FreeType implementation only loads the first font face in the TTC. This isn't ideal as the same character may look different in different languages.
Without TTC support, we need to bundle 4 font files to cover all CJK characters, and we can't use the .ttc file included in Android system already. That would make the app super heavy.
This commit allows loading a certain font face from a font collection file such as TTC.
TTC file is very important for CJK fonts. For example, Android includes
.ttc
font files for CJK characters due to the fact that Chinese/Japanese/Korean share a lot of characters. Without a.ttc
file, we need four files (each file takes at least 15 MB) to support all of Japanese/Chinese/Korean characters. The Noto-CJK TTC font file included in Android only takes ~25 MB.Currently, the stb implementation in NanoVG does not support TTC at all as mentioned in #554. And the FreeType implementation only loads the first font face in the TTC. This isn't ideal as the same character may look different in different languages.
Without TTC support, we need to bundle 4 font files to cover all CJK characters, and we can't use the
.ttc
file included in Android system already. That would make the app super heavy.