5

Noto CJK font is an OpenType CJK font developed by Google and Adobe.

In ConTeXt, if I write

\definefontfamily [myfamily] [serif] [Noto Serif CJK SC]

then context will hang on loading the Noto font. It complains:

loading of table 'vorg' skipped
invalid index in single format 1: 64605 -> 67219 (max 65535)
rule 1 in gsub lookup 's_s_5' has empty lookups

Then it prints nothing. The memory usage rapidly rises to several GB. I had to manually kill the program.

However the font works well with XeTeX or LuaTeX alone. What is the proper way to make it work with ConTeXt?

5

It works without a problem for me. However, building the caches takes 50% of my RAM which is 8 GB!

This is the official statement by Hans about the situation

these fonts are huge ... and memory usage in lua can be large as allocations doubles when more is needed, but in the end the font gets stored quite efficient in the cache, so it's a one-time memory usage

I'm using mtxrun to build the font caches:

$ mtxrun --script font --convert NotoSerifCJKsc-Regular.otf 
otf reader      | loading of table 'vorg' skipped
otf reader      | invalid index in single format 1: 64605 -> 67219 (max 65535)
otf reader      | rule 1 in gsub lookup 's_s_5' has empty lookups
otf reader      | merging 3 steps of 'gpos_single' lookup 'p_s_2'
otf reader      | merging 4 steps of 'gpos_pair' lookup 'p_s_3'
otf reader      | turning pairs of step 1 of 'gpos_pair' lookup 'p_s_3' into kerns
otf reader      | merging 7 steps of 'gpos_single' lookup 'p_s_4'
otf reader      | merging 3 steps of 'gpos_single' lookup 'p_s_5'
otf reader      | merging 2 steps of 'gpos_pair' lookup 'p_s_6'
otf reader      | merging 5 steps of 'gpos_single' lookup 'p_s_7'
otf reader      | 18 steps of 343 removed due to merging
otf reader      | 1 steps of 343 steps turned from pairs into kerns
otf reader      | adding soft hyphen
otf reader      | duplicates: 1 :   (U+02003) @ I00574   (U+03000)
[...snip...]
otf reader      | duplicates: 1 : ➡ (U+027A1) @ I0053A ⮕ (U+02B95)
mtx-fonts       | font: 'NotoSerifCJKsc-Regular.otf' saved as 'noto serif cjk sc.lua'

Also running with ConTeXt works fine. Here is a MWE:

\definefont[noto][file:NotoSerifCJKsc-Regular.otf]
\starttext
\noto 樂
\stoptext

enter image description here

The first run takes 50 seconds and eats 8GB of RAM, but the successive runs take less than 2 seconds and only a few MB of RAM.

If you don't have enough memory, try downloading more RAM.

  • I have no idea what the symbol means. I hope it's not insulting. – Henri Menke Sep 30 '18 at 3:30
  • Thanks. It's a traditional Chinese character meaning "joy, happiness" :) – user2249675 Sep 30 '18 at 3:32
  • @user2249675 Phew, got lucky on this one :) Because the memory consumption is so huge, you might be interested in section 9.2.1 “Trimming fonts“ in Fonts out of ConTeXt. – Henri Menke Sep 30 '18 at 3:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.