Re: [NTG-context] Variable instance identifiers exhausted
On 9/19/2018 10:45 PM, Alan Braslau wrote: Metapost does not have a very efficient mechanism for keeping objects in memory and does not have a very efficient or real array mechanism, rather it uses hashed lists. fwiw, keeping objects as such in memory is quite ok, hashing is also ok, but indeed arrays are not really arrays but linked lists into the hash (which actually you can speed up a lot) so, here is a teaser for Alan (no lua magic here, just knowledge of how mp hashes): \dontleavehmode \testfeatureonce{1}{ \startMPcode numeric foo[]; def set_foo(expr c, s) = foo[c]:= s ; enddef ; def get_foo(expr c) = foo[c] enddef ; for i=1 upto 1 : set_foo(i,i) ; endfor ; draw textext("set one dimensional"); \stopMPcode } \elapsedtime \blank \dontleavehmode \testfeatureonce{1}{ \startMPcode numeric n ; for i=1 upto 1 : n := get_foo(i) ; endfor ; draw textext("get one dimensional"); \stopMPcode } \elapsedtime \blank \dontleavehmode \testfeatureonce{1}{ \startMPcode numeric foo[][][][]; def set_foo(expr c, s) = foo[c div 1000][c div 100][c div 10][c] := s ; enddef ; def get_foo(expr c) = foo[c div 1000][c div 100][c div 10][c] enddef ; for i=1 upto 1 : set_foo(i,i) ; endfor ; numeric n ; for i=1 upto 1 : n := get_foo(i) ; endfor ; draw textext("set four dimensional" ); \stopMPcode } \elapsedtime \blank \dontleavehmode \testfeatureonce{1}{ \startMPcode numeric n ; for i=1 upto 1 : n := get_foo(i) ; endfor ; draw textext("get four dimensional"); \stopMPcode } \elapsedtime \blank Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Variable instance identifiers exhausted
On Tue, 18 Sep 2018 19:21:31 -0700 Fabrice L wrote: > The problem is that the process take hours of compilations, and > tests are not easy to do. Anyway, I will enrich my « minimal » code to my > « full » code in order to find the difference… and the problem. I will > update the thread as soon as can. My over 700k object graphics example, processed several times (repeatedly, over several pages with modifications) took less than one minute to process. In fact, each graphic took almost as long to render from the pdf as it did for metapost/lua to process. Alan ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Variable instance identifiers exhausted
On Wed, 19 Sep 2018 09:28:36 +0200 Hans Hagen wrote: > On 9/19/2018 4:24 AM, Fabrice L wrote: > > > I do not think this a loop problem, because the same code runs ok for 15 > > 000 objects, but give an error for 18 000 objects. I’m working to build > > a minimal example. > So what do you do with the objects? At the ctx meeting we've seen > examples of graphics using many more than 15K that processed fast and > also (maybe surprisingly) could be previewed quite ok. So, indeed a > minimal example would help. No, it was more than 700k objects! Alan ;-) ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] font in \setuplanguage
On 9/18/18 5:50 AM, Wolfgang Schuster wrote: > With the font key you can apply certain font features for a different > language but you can’t use it to switch to a different font. > > To switch to a different font for your greek texts use this method: Many thanks for your reply, Wolfgang. I wonder whether it would make sense to enable a style option in \setuplanguage. Having to use setups is maybe too difficult for newcomers and style is a common option in other commands. I agree that font is handy when using different languages using the Latin script. But style would make sense when dealing with different scripts. Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] MetaFun: How to draw bent paths?
On Wed, 19 Sep 2018 11:18:30 +1200 Henri Menke wrote: > On 18/09/18 21:23, Henri Menke wrote: > > On 9/18/18 7:57 PM, Hans Hagen wrote: > >> On 9/16/2018 10:28 AM, Henri Menke wrote: > >>> Dear list, > >>> > >>> I want to draw paths between points which are bent by a certain angle. > >>> The code in the MWE below works well but I was thinking that the expert > >>> here can surely improve it and suggest a nicer syntax. > >> looks like a challenge for Alan ... isn't it also a bit 3d (2.5d)? > > > > I wasn't thinking about a 3D application here, just a little bend on the > > path to go around other elements in my drawing without having to think > > about explicit control points (like the second example in my original > > post). In the meantime I have improved the defintion of the macro to > > avoid double computation of the angle: > > > > vardef bend(expr a,b,phi) = > > save x ; > > x := angle(b-a) ; > > a{dir(x+phi)} .. {dir(x-phi)}b > > enddef ; > > > > So currently the applied syntax is > > > > drawarrow bend(z1, z2, 30) ; > > > > However, I would prefer something like > > > > drawarrow z1 bend(30) z2 ; > > > > I'm not sure whether this is possible though. Actually I'm reading the > > MetaPost manual right know because my MP skills are rather poor. > > I think I got it now. Not sure whether “bend” should be primary or > something else. > > \startMPdefinitions > primarydef a bend phi = > do_bend(a,phi) > enddef ; > > vardef do_bend(expr a, phi) expr b = > save x ; > x := angle(b-a) ; > a{dir(x+phi)} .. {dir(x-phi)}b > enddef ; > \stopMPdefinitions > > \starttext > > \startMPpage > z1 = (-.5cm,1cm) ; > z2 = (1cm,3cm) ; > > for phi = 0 step 5 until 360: > draw z1 bend(phi) z2 withcolor (phi/360)[red,blue] ; > endfor ; > \stopMPpage > > % Possible use case: > > \startMPpage[offset=1cm] > z1 = (-.5cm,1cm) ; > z2 = (1cm,3cm) ; > draw z1 -- z2 ; > dotlabel.lft("$-$", z1) ; > dotlabel.lft("$+$", z2) ; > > path p; p := z1 bend(-30) z2 ; > drawdblarrow p withcolor blue ; > label.lrt(textext("$\Delta$"),point .5 along p) withcolor blue ; > \stopMPpage > > \stoptext Henri, 1. I added a sanity test (angle(origin) is undefined); 2. it is probably more efficient to calculate the angle twice than to allocate storage; 3. primary b; 4. then I created the variant arc (as in a bow) taking a delta (the tangent of an angle). Alan \startMPdefinitions primarydef a bend phi = do_bend(a,phi) enddef ; vardef do_bend(expr a, phi) primary b = if abs(a-b)=0 : a else : (a{dir(angle(b-a)+phi)} .. {dir(angle(b-a)-phi)}b) fi enddef ; primarydef a arc delta = do_arc(a,delta) enddef ; vardef do_arc(expr a,delta) primary b = if abs(a-b)=0 : a else : (a .. unitvector direction .5 of (a--b) rotated 90 scaled delta * arclength (a--b) shifted .5[a,b] .. b) fi enddef ; \stopMPdefinitions \starttext \startMPpage z1 = (-.5cm,1cm) ; z2 = (1cm,3cm) ; for phi = 0 step 5 until 360: draw z1 bend phi z2 withcolor (phi/360)[red,blue] ; endfor ; \stopMPpage \startMPpage z1 = (-.5cm,1cm) ; z2 = (1cm,3cm) ; for delta = -1 step .1 until 1: draw z1 arc delta z2 withcolor ((delta+1)/2)[red,blue] ; endfor ; \stopMPpage % Possible use case: \startMPpage[offset=1cm] z1 = (-.5cm,1cm) ; z2 = (1cm,3cm) ; draw z1 -- z2 ; dotlabel.lft("$-$", z1) ; dotlabel.lft("$+$", z2) ; path p; p := z1 bend(-30) z2 ; drawdblarrow p withcolor blue ; label.lrt(textext("$\Delta$"),point .5 along p) withcolor blue ; \stopMPpage \stoptext ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
Am Wed, 19 Sep 2018 13:50:37 +0200 schrieb Ulrike Fischer: > I guess I should reinstall context here, probably it is too old and > never got the 64bit binaries. I did reinstall context and now a 64bit luatex is used on my pc too and the problem is gone. I also installed a 64bit luatex for texlive and now the font can also be used with latex. The first time for me that a 64bit application makes really a difference ;-). -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] xml in lua advice ?
Hi, > it actually depends on what you do ... anyway here is some insight (as > xml-tex old-timer you'll probably recognize the madness) What I am mostly trying to do is to have as much of the xml processing in lua as possible. > > % \enabletrackers[context*] > > \starttext > > % here is your missing mwe Yes, sorry about that. My question was intended to be more of an documentation-related one. Using your MWE as guideline, my minimal file looks like this: % BEGIN ENVIRONMENT \startluacode function xml.functions.document(t) lxml.flush(t) end function xml.functions.b(t) context.start() context.bf() lxml.flush(t) context.stop() context("{}") end function xml.functions.section(t) context.section("{") lxml.flush(t) context("}") end \stopluacode \startxmlsetups mysetups % to be converted to lua later \xmlsetfunction {main}{document}{xml.functions.document} \xmlsetfunction {main}{section} {xml.functions.section} \xmlsetfunction {main}{b} {xml.functions.b} \stopxmlsetups \xmlregistersetup{mysetups} % to be converted to lua later % XML normally in separate file \starttext \startbuffer[test] some bold title \stopbuffer \xmlprocessbuffer{main}{test}{} \stoptext % END EXAMPLE I know it would be simple to write e.g. \startsetups xml:section \section{\xmlflush{#1}} \stopsetups but I was aiming for a simple, clean-looking CLD as style setup of the XML document. I doubt I could explain your MWE to one of my coworkers, as I hardly understand it myself :) What I was really hoping for was something like the fictional: function xml.functions.section(t) context.section(lxml.process_into_context_string(t)) end or some CLD extension so that it would actually understand function xml.functions.section(t) context.section(lxml.flush(t)) end I hope this makes more sense now. Unless something magical is possible, it seems my best bet is to stick with \startsetups instead of lua for these cases, just to make sure I can explain to the rest of the office what is going on. Thanks, Taco ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] xml in lua advice ?
My 2 cents: local xmlflush = lxml.flush local function text_or_xml(...) for i,v in ipairs(arg) do if "table" == type(v) then xmlflush(v) else context(v) end end end function xml.functions.heading(t) text_or_xml( "\\section{" , t , "}" ) end Massimiliano Il giorno mer, 19/09/2018 alle 15.56 +0200, Hans Hagen ha scritto: > On 9/19/2018 2:50 PM, Taco Hoekwater wrote: > > Hi, > > > > Is there a more elegant way to feed an xml tree into a context() > > command > > that what I have below? > > > > > > \startluacode > > function xml.functions.heading(t) > > context.section("{") > > lxml.flush(t) > > context("}") > > end > > \stopluacode > > > > The subtree in ’t’ could have embedded xml tags that should be > > processed, > > so just stripping it clean will not do. > > > > (this is not about \section as such, I just needed an example. > > \startsection > > would be more modern, but it would not help fix the issue ) > > it actually depends on what you do ... anyway here is some insight > (as > xml-tex old-timer you'll probably recognize the madness) > > % \enabletrackers[context*] > > \starttext > > % here is your missing mwe > > \startbuffer[test] > > some bold title > > \stopbuffer > > % this will assume xml and relate some handlers > > \setuphead[section] >[coding=xml, > xmlsetup=xml:flush] > > \startxmlsetups xml:flush > \xmlflush{#1} > \stopxmlsetups > > % comment this one for your amusement > > \startxmlsetups xml:b > {\bf \xmlflush{#1}} > \stopxmlsetups > > % here is the magic: you pass a reference > > \startluacode > function xml.finalizers.heading(t) > context.formatted.section("main::%i",t[1].ix) > end > \stopluacode > > % this loads only (can happen at the lua end ... you can sort that > out) > > \xmlloadbuffer{main}{test}{} > > % this indexes the nodes (the ix keys, basically all these #1 > argumehnts > in setups use that trickery) > > \xmladdindex{main} > > % to be sure > > \xmlsetsetup{main}{b}{xml:b} > > % now we filter / apply your finalizer > > \xmlfilter{main}{section/heading()} > > % done > > \stoptext > > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > _ > __ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > _ > __ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] xml in lua advice ?
On 9/19/2018 2:50 PM, Taco Hoekwater wrote: Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’ could have embedded xml tags that should be processed, so just stripping it clean will not do. (this is not about \section as such, I just needed an example. \startsection would be more modern, but it would not help fix the issue ) it actually depends on what you do ... anyway here is some insight (as xml-tex old-timer you'll probably recognize the madness) % \enabletrackers[context*] \starttext % here is your missing mwe \startbuffer[test] some bold title \stopbuffer % this will assume xml and relate some handlers \setuphead[section] [coding=xml, xmlsetup=xml:flush] \startxmlsetups xml:flush \xmlflush{#1} \stopxmlsetups % comment this one for your amusement \startxmlsetups xml:b {\bf \xmlflush{#1}} \stopxmlsetups % here is the magic: you pass a reference \startluacode function xml.finalizers.heading(t) context.formatted.section("main::%i",t[1].ix) end \stopluacode % this loads only (can happen at the lua end ... you can sort that out) \xmlloadbuffer{main}{test}{} % this indexes the nodes (the ix keys, basically all these #1 argumehnts in setups use that trickery) \xmladdindex{main} % to be sure \xmlsetsetup{main}{b}{xml:b} % now we filter / apply your finalizer \xmlfilter{main}{section/heading()} % done \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] xml in lua advice ?
Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’ could have embedded xml tags that should be processed, so just stripping it clean will not do. (this is not about \section as such, I just needed an example. \startsection would be more modern, but it would not help fix the issue ) Thanks for any help, Taco ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
Am Wed, 19 Sep 2018 13:22:40 +0200 schrieb Hans Hagen: >> Is there one for context minimals? And if yes, how could I install >> and activate it? > when you install the context distribution from the garden it should load 64 It doesn't on my PC, there is only a texmf-mswin, but I checked on another and there I have a texmf-mswin64, and my example compiles. I guess I should reinstall context here, probably it is too old and never got the 64bit binaries. -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
On 9/19/2018 12:15 PM, Ulrike Fischer wrote: Am Wed, 19 Sep 2018 11:36:40 +0200 schrieb Taco Hoekwater: Note, however, that the luatex process tops out at nearly 3GB RAM use while generating the cached version, which could be a problem on 32-bit operating systems. I have a 64bit OS and 8GB RAM. According to the task manager luatex itself is 32bit. Are you using a 64bit luatex? Is there one for context minimals? And if yes, how could I install and activate it? when you install the context distribution from the garden it should load 64 - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
> On 19 Sep 2018, at 12:20, luigi scarso wrote: > > > > On Wed, Sep 19, 2018 at 12:15 PM Ulrike Fischer wrote: > Am Wed, 19 Sep 2018 11:36:40 +0200 schrieb Taco Hoekwater: > > > Note, however, that the luatex process tops out at nearly 3GB RAM > > use while generating the cached version, which could be a problem > > on 32-bit operating systems. > > I have a 64bit OS and 8GB RAM. According to the task manager luatex > itself is 32bit. > > Are you using a 64bit luatex? Yes, but I am on macos. Best wishes, Taco ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
On Wed, Sep 19, 2018 at 12:15 PM Ulrike Fischer wrote: > Am Wed, 19 Sep 2018 11:36:40 +0200 schrieb Taco Hoekwater: > > > Note, however, that the luatex process tops out at nearly 3GB RAM > > use while generating the cached version, which could be a problem > > on 32-bit operating systems. > > I have a 64bit OS and 8GB RAM. According to the task manager luatex > itself is 32bit. > > Are you using a 64bit luatex? > > Is there one for context minimals? And if yes, how could I install > and activate it? > w32tex by Akira Kakuto ? -- luigi ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
Am Wed, 19 Sep 2018 11:36:40 +0200 schrieb Taco Hoekwater: > Note, however, that the luatex process tops out at nearly 3GB RAM > use while generating the cached version, which could be a problem > on 32-bit operating systems. I have a 64bit OS and 8GB RAM. According to the task manager luatex itself is 32bit. Are you using a 64bit luatex? Is there one for context minimals? And if yes, how could I install and activate it? -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
On Wed, Sep 19, 2018 at 11:39 AM Hans Hagen wrote: > > the first time caching takes some 23 sec on my (also not that new) > machine but after that loading takes way less time (some .4 sec) > > same results here for texlive 2018 on linux64bit Without cache system | total runtime: 23.496 seconds Withcache system | total runtime: 1.515 seconds No problem with context texlive 2018 & context with latest experimental -- luigi ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
On 9/19/2018 11:17 AM, Ulrike Fischer wrote: Am Wed, 19 Sep 2018 10:54:08 +0200 schrieb Hans Hagen: On 9/19/2018 10:24 AM, Ulrike Fischer wrote: Because of a question on tex.sx I tried to use the source han sans fonts. I installed (in windows 10) the fonts from this zip-file: https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip Trying to use them with latex/luaotfload failed with a memory exhausted error while trying to write the lua-file. In context \starttext \font\test={name:sourcehansans} \test abc \stoptext gave the error: fonts > otf loading > loading 'c:/windows/fonts/SourceHanSans-Regular.otf', hash 'sourcehansans-regular' otf reader > loading of table 'vorg' skipped otf reader > invalid index in single format 1: 65353 -> 67212 (max 65535) otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups fonts > otf loading > loading failed due to read error fonts > defining > forced type 'otf' of 'c:/windows/fonts/SourceHanSans-Regular' not found fonts > defining > font with asked name 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup 'name' fonts > defining > unknown font 'c:/windows/fonts/SourceHanSans-Regular', loading aborted xelatex had no problems to use the font. Is this an error in the font or in the fontloader? it works ok here with luatex but ... do you use luajittex? No (neither with lualatex). The context log says at the end: mkiv lua stats > used platform: mswin, type: windows, binary subtree: texmf-mswin mkiv lua stats > used engine: luatex version 1.09 with functionality level 6930, banner: this is luatex, version 1.09.0 (tex live 2018/w32tex) mkiv lua stats > control sequences: 45351 of 65536 + 10 mkiv lua stats > lua properties: engine: lua 5.3, used memory: 1519 MB (ctx: 1460 MB), hash type: lua, hash chars: min(32,40), symbol mask: utf (τεχ) mkiv lua stats > runtime: 39.711 seconds The fonts *are* large, and my computer is quite old, so it could be a hardware problem, but I'm wondering a bit about the message otf reader > invalid index in single format 1: 65353 -> 67212 sure, but afaiks that's taken care of, but it still loads ... so given the computer maybe a memory issue? can you run with the task manager open? it does need some mem when serializing so maybe your virtual mem is not enough? the first time caching takes some 23 sec on my (also not that new) machine but after that loading takes way less time (some .4 sec) maybe use the ttc files instead: sourcehansans-normal.ttc Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
Hi, Here is what I get (ConTeXt ver: 2018.09.13 17:41 MKIV beta, luatex 1.09): fonts > otf loading > loading '/Users/taco/context-maps/tex/texmf-fonts/fonts/data/SourceHanSans-Regular.otf', hash 'sourcehansans-regular' otf reader > loading of table 'vorg' skipped otf reader > invalid index in single format 1: 65353 -> 67212 (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_0' otf reader > merging 2 steps of 'gpos_pair' lookup 'p_s_1' otf reader > turning pairs of step 1 of 'gpos_pair' lookup 'p_s_1' into kerns otf reader > merging 11 steps of 'gpos_single' lookup 'p_s_2' otf reader > merging 3 steps of 'gpos_single' lookup 'p_s_3' otf reader > merging 10 steps of 'gpos_single' lookup 'p_s_5' otf reader > 24 steps of 351 removed due to merging otf reader > 1 steps of 351 steps turned from pairs into kerns otf reader > duplicates: 33 : [null] @ I1 [soh] [stx] [etx] [eot] [enq] [ack] [bel] [bs] [ht] [lf] [vt] [ff] [cr] [so] [si] [dle] [dc1] [dc2] [dc3] [dc4] [nak] [syn] [etb] [can] [em] ... otf reader > duplicates: 1 : (U+02002) @ I0F63F ᅠ (U+0FFA0) … lots more duplicates and a successful run despite all that. Note, however, that the luatex process tops out at nearly 3GB RAM use while generating the cached version, which could be a problem on 32-bit operating systems. Best wishes, Taco > On 19 Sep 2018, at 11:21, luigi scarso wrote: > > > > On Wed, Sep 19, 2018 at 11:18 AM Ulrike Fischer wrote: > Am Wed, 19 Sep 2018 10:54:08 +0200 schrieb Hans Hagen: > > > On 9/19/2018 10:24 AM, Ulrike Fischer wrote: > >> > >> Because of a question on tex.sx I tried to use the source han sans > >> fonts. I installed (in windows 10) the fonts from this zip-file: > >> > >> https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip > >> > >> Trying to use them with latex/luaotfload failed with a memory > >> exhausted error while trying to write the lua-file. In context > >> > >> \starttext > >> \font\test={name:sourcehansans} > >> \test abc > >> \stoptext > >> > >> gave the error: > >> > >> fonts > otf loading > loading > >> 'c:/windows/fonts/SourceHanSans-Regular.otf', hash > >> 'sourcehansans-regular' > >> otf reader > loading of table 'vorg' skipped > >> otf reader > invalid index in single format 1: 65353 -> 67212 > >> (max 65535) > >> otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups > >> fonts > otf loading > loading failed due to read error > >> fonts > defining > forced type 'otf' of > >> 'c:/windows/fonts/SourceHanSans-Regular' not found > >> fonts > defining > font with asked name > >> 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup > >> 'name' > >> fonts > defining > unknown font > >> 'c:/windows/fonts/SourceHanSans-Regular', loading aborted > >> > >> > >> xelatex had no problems to use the font. > >> > >> Is this an error in the font or in the fontloader? > > it works ok here with luatex > > > > but ... do you use luajittex? > > No (neither with lualatex). > > The context log says at the end: > > mkiv lua stats > used platform: mswin, type: windows, binary > subtree: texmf-mswin > mkiv lua stats > used engine: luatex version 1.09 with > functionality level 6930, banner: this is luatex, version 1.09.0 > (tex live 2018/w32tex) > mkiv lua stats > control sequences: 45351 of 65536 + 10 > mkiv lua stats > lua properties: engine: lua 5.3, used memory: 1519 > MB (ctx: 1460 MB), hash type: lua, hash chars: min(32,40), symbol > mask: utf (τεχ) > mkiv lua stats > runtime: 39.711 seconds > > The fonts *are* large, and my computer is quite old, so it could be > a hardware problem, but I'm wondering a bit about the message > > > otf reader > invalid index in single format 1: 65353 -> 67212 > > hm > checking now > > -- > luigi > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ Taco Hoekwater Elvenkind BV ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
Re: [NTG-context] Using the source han sans fonts fails
On Wed, Sep 19, 2018 at 11:18 AM Ulrike Fischer wrote: > Am Wed, 19 Sep 2018 10:54:08 +0200 schrieb Hans Hagen: > > > On 9/19/2018 10:24 AM, Ulrike Fischer wrote: > >> > >> Because of a question on tex.sx I tried to use the source han sans > >> fonts. I installed (in windows 10) the fonts from this zip-file: > >> > >> > https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip > >> > >> Trying to use them with latex/luaotfload failed with a memory > >> exhausted error while trying to write the lua-file. In context > >> > >> \starttext > >> \font\test={name:sourcehansans} > >> \test abc > >> \stoptext > >> > >> gave the error: > >> > >> fonts > otf loading > loading > >> 'c:/windows/fonts/SourceHanSans-Regular.otf', hash > >> 'sourcehansans-regular' > >> otf reader > loading of table 'vorg' skipped > >> otf reader > invalid index in single format 1: 65353 -> 67212 > >> (max 65535) > >> otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups > >> fonts > otf loading > loading failed due to read error > >> fonts > defining > forced type 'otf' of > >> 'c:/windows/fonts/SourceHanSans-Regular' not found > >> fonts > defining > font with asked name > >> 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup > >> 'name' > >> fonts > defining > unknown font > >> 'c:/windows/fonts/SourceHanSans-Regular', loading aborted > >> > >> > >> xelatex had no problems to use the font. > >> > >> Is this an error in the font or in the fontloader? > > it works ok here with luatex > > > > but ... do you use luajittex? > > No (neither with lualatex). > > The context log says at the end: > > mkiv lua stats > used platform: mswin, type: windows, binary > subtree: texmf-mswin > mkiv lua stats > used engine: luatex version 1.09 with > functionality level 6930, banner: this is luatex, version 1.09.0 > (tex live 2018/w32tex) > mkiv lua stats > control sequences: 45351 of 65536 + 10 > mkiv lua stats > lua properties: engine: lua 5.3, used memory: 1519 > MB (ctx: 1460 MB), hash type: lua, hash chars: min(32,40), symbol > mask: utf (τεχ) > mkiv lua stats > runtime: 39.711 seconds > > The fonts *are* large, and my computer is quite old, so it could be > a hardware problem, but I'm wondering a bit about the message > > > otf reader > invalid index in single format 1: 65353 -> 67212 > > hm checking now -- luigi ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
Am Wed, 19 Sep 2018 10:54:08 +0200 schrieb Hans Hagen: > On 9/19/2018 10:24 AM, Ulrike Fischer wrote: >> >> Because of a question on tex.sx I tried to use the source han sans >> fonts. I installed (in windows 10) the fonts from this zip-file: >> >> https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip >> >> Trying to use them with latex/luaotfload failed with a memory >> exhausted error while trying to write the lua-file. In context >> >> \starttext >> \font\test={name:sourcehansans} >> \test abc >> \stoptext >> >> gave the error: >> >> fonts > otf loading > loading >> 'c:/windows/fonts/SourceHanSans-Regular.otf', hash >> 'sourcehansans-regular' >> otf reader > loading of table 'vorg' skipped >> otf reader > invalid index in single format 1: 65353 -> 67212 >> (max 65535) >> otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups >> fonts > otf loading > loading failed due to read error >> fonts > defining > forced type 'otf' of >> 'c:/windows/fonts/SourceHanSans-Regular' not found >> fonts > defining > font with asked name >> 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup >> 'name' >> fonts > defining > unknown font >> 'c:/windows/fonts/SourceHanSans-Regular', loading aborted >> >> >> xelatex had no problems to use the font. >> >> Is this an error in the font or in the fontloader? > it works ok here with luatex > > but ... do you use luajittex? No (neither with lualatex). The context log says at the end: mkiv lua stats > used platform: mswin, type: windows, binary subtree: texmf-mswin mkiv lua stats > used engine: luatex version 1.09 with functionality level 6930, banner: this is luatex, version 1.09.0 (tex live 2018/w32tex) mkiv lua stats > control sequences: 45351 of 65536 + 10 mkiv lua stats > lua properties: engine: lua 5.3, used memory: 1519 MB (ctx: 1460 MB), hash type: lua, hash chars: min(32,40), symbol mask: utf (τεχ) mkiv lua stats > runtime: 39.711 seconds The fonts *are* large, and my computer is quite old, so it could be a hardware problem, but I'm wondering a bit about the message > otf reader > invalid index in single format 1: 65353 -> 67212 -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Using the source han sans fonts fails
On 9/19/2018 10:24 AM, Ulrike Fischer wrote: Because of a question on tex.sx I tried to use the source han sans fonts. I installed (in windows 10) the fonts from this zip-file: https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip Trying to use them with latex/luaotfload failed with a memory exhausted error while trying to write the lua-file. In context \starttext \font\test={name:sourcehansans} \test abc \stoptext gave the error: fonts > otf loading > loading 'c:/windows/fonts/SourceHanSans-Regular.otf', hash 'sourcehansans-regular' otf reader > loading of table 'vorg' skipped otf reader > invalid index in single format 1: 65353 -> 67212 (max 65535) otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups fonts > otf loading > loading failed due to read error fonts > defining > forced type 'otf' of 'c:/windows/fonts/SourceHanSans-Regular' not found fonts > defining > font with asked name 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup 'name' fonts > defining > unknown font 'c:/windows/fonts/SourceHanSans-Regular', loading aborted xelatex had no problems to use the font. Is this an error in the font or in the fontloader? it works ok here with luatex but ... do you use luajittex? if so, forget about it as luajit has some limitations wrr memory and loading tables from stack (adapting the code to deal with that will make it a mess and we can't even be sure how long luajit will be around and supported in luatex anyway) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Using the source han sans fonts fails
Because of a question on tex.sx I tried to use the source han sans fonts. I installed (in windows 10) the fonts from this zip-file: https://github.com/adobe-fonts/source-han-sans/blob/release/OTF/SourceHanSansJ.zip Trying to use them with latex/luaotfload failed with a memory exhausted error while trying to write the lua-file. In context \starttext \font\test={name:sourcehansans} \test abc \stoptext gave the error: fonts > otf loading > loading 'c:/windows/fonts/SourceHanSans-Regular.otf', hash 'sourcehansans-regular' otf reader > loading of table 'vorg' skipped otf reader > invalid index in single format 1: 65353 -> 67212 (max 65535) otf reader > rule 1 in gsub lookup 's_s_5' has empty lookups fonts > otf loading > loading failed due to read error fonts > defining > forced type 'otf' of 'c:/windows/fonts/SourceHanSans-Regular' not found fonts > defining > font with asked name 'c:/windows/fonts/SourceHanSans-Regular' is not found using lookup 'name' fonts > defining > unknown font 'c:/windows/fonts/SourceHanSans-Regular', loading aborted xelatex had no problems to use the font. Is this an error in the font or in the fontloader? -- Ulrike Fischer http://www.troubleshooting-tex.de/ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Variable instance identifiers exhausted
On 9/19/2018 4:24 AM, Fabrice L wrote: I do not think this a loop problem, because the same code runs ok for 15 000 objects, but give an error for 18 000 objects. I’m working to build a minimal example. So what do you do with the objects? At the ctx meeting we've seen examples of graphics using many more than 15K that processed fast and also (maybe surprisingly) could be previewed quite ok. So, indeed a minimal example would help. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___