[NTG-context] Set: The Card Game

2014-09-25 Thread Thangalin
Hi,

Another ConTeXt example.

https://bitbucket.org/djarvis/salish-card-set/src/

Included is a script (svg2mp.sh) that converts SVG files into MetaPost
code. This allows for editing the image shapes in Inkscape (or
similar) then manipulating them in MetaPost.

This example code produces a thematic variation on Set. There are a
few unsightly hacks, and some duplicated code that could be
eliminated.

Improvements and general comments are welcome.
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] parbuilder in lua

2014-09-25 Thread Taco Hoekwater
Hi Hans,

Can you please try the code below? I found three issues with it:

1. node-ltp.lua is not completely ready for nuts mode, e.g. line 3148:

  elseif order == 0 and hlist.list and last_badness  tex.hbadness then

  where ‘hlist.list' should be 'getfield(hlist, list”)’

2. with tracing on, I always get: 

   Lua linebreak_filter failed, reverting to default on line 1

   which makes me nervous. Does that mean it works ok without tracing, or does 
it
  just not report that it does not work?

3. with tracing on, there is a double-free of a glyph node (this could be 
specific to tufte)

TIA,
Taco

Code:

\tracingparagraphs=1
\tracingonline=1
\starttext
\startparbuilder[basic]
\input tufte
\stopparbuilder
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Latest beta stops loading some ttc fonts

2014-09-25 Thread Hongwen Qiu

The following minimal example used to work fine:
\starttypescript [serif] [zhfonts]
  \definefontsynonym [Serif] [name:nsimsun]
\stoptypescript

\starttypescript [zhfonts]
  \definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript

\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]

\starttext

测试

\stoptext

but it's no longer the case.

The font used here is 'simsun.ttc' which ships with Chinese edition 
Windows systems by default.
When I require name:nsimsun as above, the TTFAddLangStr() function in 
the luatex code base will have the following information:

fontname lang
NSimSun   0
NSimSun  1033
新宋体   2052
That is when lang equals 0 or 1033, the fontname will be NSimSun, but 
when lang equals 2052, the fontname will be 新宋体, the Chinese words 
for NSimSun.
Although the ValidatePostScriptFontName() complains about the Chinese 
name of this font, and set 'bad_ps_fontname' to true, luatex itself 
don't stop the font fromgetting the right fontname NSimSun, since it 
chooses ASCII names when there're multiple fontnames.


But actions[check metadata](font-otf.lua, 1812),sets the 
metadata.fontname from the correct NSimSun to bad-fontname-simsun, 
and this change causes ff_get_ttc_index() to always return -1 as the 
index, which caused ConTeXt to complain about the following error 
message before bail out:


(bad-fontname-simsun:-1)Invalid TTC index number

mtx-context | fatal error: return code: 1

So, maybe font-otf.lua may need not change metadata.fontname and 
metadata.fullname if these two names are not nil?

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] parbuilder in lua

2014-09-25 Thread Hans Hagen

On 9/25/2014 9:57 AM, Taco Hoekwater wrote:

Hi Hans,

Can you please try the code below? I found three issues with it:

1. node-ltp.lua is not completely ready for nuts mode, e.g. line 3148:

   elseif order == 0 and hlist.list and last_badness  tex.hbadness then

   where ‘hlist.list' should be 'getfield(hlist, list”)’


getlist(hlist)


2. with tracing on, I always get:

Lua linebreak_filter failed, reverting to default on line 1


I've seen that before so I need to check the luatex code too.


which makes me nervous. Does that mean it works ok without tracing, or does 
it
   just not report that it does not work?


cur_p - current

local save_link = getnext(current)
setfield(current,next,nil)
write_nl(log,)
par.font_in_short_display = 
short_display(log,getnext(printed_node),par.font_in_short_display)

setfield(current,next,save_link)


3. with tracing on, there is a double-free of a glyph node (this could be 
specific to tufte)


some day i'll make an overload of the tracing for context (this code is 
somewhat evolving and i want to add some plugins as well ... maybe even 
make it kind generic so that we can play in plain tex but as this is all 
playground it has a bit low priority)



TIA,
Taco

Code:

\tracingparagraphs=1
\tracingonline=1
\starttext
\startparbuilder[basic]
\input tufte
\stopparbuilder
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] parbuilder in lua

2014-09-25 Thread Hans Hagen

On 9/25/2014 9:57 AM, Taco Hoekwater wrote:


\tracingparagraphs=1
\tracingonline=1


I must admit that i never use these ... i'm more into visualizing it -)

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Latest beta stops loading some ttc fonts

2014-09-25 Thread Hans Hagen

On 9/25/2014 10:50 AM, Hongwen Qiu wrote:

The following minimal example used to work fine:
\starttypescript [serif] [zhfonts]
   \definefontsynonym [Serif] [name:nsimsun]
\stoptypescript

\starttypescript [zhfonts]
   \definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript

\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]

\starttext

测试

\stoptext

but it's no longer the case.


is it context or the binary?

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Instruction required about hyphenation patterns

2014-09-25 Thread Francisco Gracia
As well the original TeX manual as ConTeXt's one try to dissuade one of
enquiring deeper into the subject of hyphenation patterns. For several
reasons not to be explained at this moment this is however what I want to
do.

I have read all that I have found about the subject and think to have got a
rather clear idea of the fundamental concepts. But I have been unable to
understand how they are applied and can be managed in ConTeXt. So I would
eagerly receive instruction about this question from someone who is
competent enough in the field.

As I understand that this is too involved a subject and of too little
general interest for the mailing list, I suggest that any potential teacher
sends me a private mail (fgragu...@gmail.com). I am ready to consider this
as a consultorship or tutorship.

Thanks in advance

Francisco
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] new beta

2014-09-25 Thread Hans Hagen

Hi,

the first beta after the meeting:

There are some changes to export and epub generation (will be explained 
in a manual). The most important is that there has been some 
improvements of the math export (esp fences and stackers). More will 
follow. The export now happens in a subpath. The epub generation is for 
3.0 and has more options (like --purge, --svgmath and --rename). The svg 
math works quite ok (and is needed because it looks like only firefox 
will support mathml natively).


The grid snapper has a few new methods, min, max and box that can be 
used in cases like


\snaptogrid[min]\hbox{e.g. an image}

The external figure mechanism has a new predefined conversion. One cna 
for instance say:


\setupexternalfigures
  [order={pdf,eps,png,jpg},
   conversion=cmyk.pdf,
   method=auto]

We need it for projects where printing houses use over a decade old rips.

There are probably some more things done but I already forgot about them.

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Use url to hyperlink bibliography title

2014-09-25 Thread Thangalin
Hi,

The question is also posted here:

http://tex.stackexchange.com/questions/201357/context-use-url-parameter-to-hyperlink-bibliography-title-references

My concern is that every bibtex entry type must be modified. Unless
I'm mistaken, every bibtex entry has a title, so (in theory) that
title macro should be defined and reused in a single location. It
should be a matter of finding that macro and changing its definition.

However, I've been unable to find the definition for the title macro
(there seem to be a number of macros named title or variants
thereof) and am loathe to duplicate all the bibtex entries.

Any ideas?
___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Latest beta stops loading some ttc fonts

2014-09-25 Thread Hongwen Qiu

在 2014年09月25日 18:50, Hans Hagen 写道:

On 9/25/2014 10:50 AM, Hongwen Qiu wrote:

The following minimal example used to work fine:
\starttypescript [serif] [zhfonts]
   \definefontsynonym [Serif] [name:nsimsun]
\stoptypescript

\starttypescript [zhfonts]
   \definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript

\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]

\starttext

测试

\stoptext

but it's no longer the case.


is it context or the binary?
Don't know which one changed that caused the above example to fail. I 
havn't used nsimsun for months, and indeed the above code used to run 
properly. Just heard from someone that it works in the current but not 
in the beta.


In my opinion, it's much easier to change the context code to fix this 
problem (about 2 line lua code), but maybe tweaking with the luatex code 
is the way that should be done.


I don't know anything about font format. In the luatex code, a comment 
said that PLRM only support ASCII fontnames. I suppose PLRM is short for 
PostScript Language Reference. I have a quick glance of the 3rd edition 
of PLRM, and only find that fontname have this explanation: (Optional) 
The name of the font. This entry is for information only; it is not
used by the PostScript interpreter. Ordinarily, it is the same as the 
key passed

to definefont , but it need not be.
I noticed that font can have multiple fotnames, each for a lang, just as 
I posted in the previous message that there're 3 fontnames for index 1 
of simsun.ttc. And many other Unicode fonts have non ASCII font names 
for lang other than 0 too. Just enable the warning message when loading 
font, and I noticed a lot of arabic font in the Linux box have Arabic 
font names. So I don't think that context (or luatex) should refuse to 
work when font have non-ASCII fontnames.


Currently there're other font related bugs that I'd wish getting fixed too.
I'm currently trying to find out why typesetting with sourcehansanscn 
will cause some glyphs to disapper.
e.g. the following code should typeset two glyphs 理 and 论. But the 
理 just get deleted from the output.

\starttypescript [serif] [zhfonts]
   \definefontsynonym [Serif] [name:sourcehansanscn]
\stoptypescript

\starttypescript [zhfonts]
   \definetypeface [zhfonts] [rm] [serif] [zhfonts]
\stoptypescript

\usetypescript [zhfonts]
\setupbodyfont [zhfonts, rm, 11pt]

\starttext

理论

\stoptext
FYI. this font can display 理, when I use libreOffice. I have no clue 
how to debug this problem. So some advice about debugging this kind of 
problem is helpful if you're busy to debug the problem. I'd glad to find 
out the reason why it won't work myself.


By the way, I belived that something like \definefontsynonym [Serif] 
[sourcehansanscn] used to load sourcehansanscn correctly but you must 
prefix it with name: now, otherwise it won't load any font.

___
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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___