> ok, thanks for noticing, i added a > > fontforge.close(pfbblob) >
good >> btw, when MKIV is running for the first time (i.e., no cache file). it >> will use a lot of memory (parsing a 10M font will use 700-800 MB > > hm so much? > Yes, when finish reading the following tex file without \bye using plain TeX, LuaTeX will cost 719M memory on my machine. The font used is Adobe song std light. [...@localhost ~]$ cat a.tex \directlua0{ function load_font (filename) local metrics = nil local font = fontforge.open(filename) if font then metrics = fontforge.to_table(font) fontforge.close(font) end return metrics end myfont = load_font('song.otf') } [...@localhost ~]$ when using the above script loading four fonts (you can try this by adding 3 myfont = load_font('song.otf')), the memory consumption will be higher than 1G on my machine. Remember I am using Plain TeX to do this test, MKIV will consume more memory. > also, mem consumption reported is a bit of a lie because lua seems to > allocates double of what it needed with each increment but not always use it > > otf fonts are already quite packed in mkiv (i'm considering adding an option > to mtx-font to precache fonts but i'm not sure if it's worth the trouble > > is mem consumption less a second run? Yes, dramatically less. with 4 chinese fonts loaded (I use zhfonts.tex for testing), MKIV consumes 300-400MB. Yue Wang ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________