Re: [NTG-context] ligature exceptions

2017-10-07 Thread Pablo Rodriguez
On 10/08/2017 12:14 AM, Hans Hagen wrote:
> On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:
> [...]
> forget about Algreya as it's a useless font ... it has no kerns, no 
> ligatures, no features at all so the f an whatever follows will always 
> touch or overlap due to the design

In fact, the full version is a commercial typeface:
https://www.myfonts.com/fonts/huertatipografica/alegreya-ht-pro/.

I wonder whether it makes sense to have a free font that only contains
the shapes and just nothing more.

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] ligature exceptions

2017-10-07 Thread Hans Hagen

On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:


The Brill fonts don’t work either (http://www.brill.com/about/brill-fonts).

 \definefontfamily[mainfont][rm][Alegreya]
 \definefontfamily[otherfont][rm][Brill]
 \setupbodyfont [mainfont,16pt]

 \starttext
 \startTEXpage[offset=1em]
 \startbuffer
 falsch: Auflage Kampffront

 richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

 \setreplacements[eka]
 richtig: Auflage Kampffront

 f ft fl fk fb ff

 f f\/t f\/l f\/k f\/b f\/f
 \resetreplacements
 \stopbuffer

 \getbuffer

 \setupbodyfont[times]\getbuffer

 \setupbodyfont[otherfont]\getbuffer
 \stopTEXpage
 \stoptext
You need to define features before fonts get defined because we share 
font definitions and their features as much as possible


\startluacode
fonts.handlers.otf.addfeature {
name = "kernligatures",
type = "kern",
data = {
f = { i = 50, l = 50 },
}
}
\stopluacode

\blockligatures[u:fl:a]

Now we can use them

\definefontfamily[mainfont][rm][Brill]
\definefontfamily[mainfont][tt][Dejavu]

\setupbodyfont[mainfont]

\definefontfeature[default:b][default][blockligatures=yes]
\definefontfeature[default:k][default][blockligatures=yes,kernligatures=yes]

\showfontkerns

\starttext

{\definedfont[Serif*default   @ 11pt]auflage}\par
{\definedfont[Serif*default:b @ 11pt]auflage}\par
{\definedfont[Serif*default:k @ 11pt]auflage}\par

\stoptext

so, you need to add a kern too because brill assumes ligatures to be applied

as usual with tex .. there's always a way out but not always a trivial 
one and of course all this gets forgotten and/or lost in the flood of 
solutions


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] ligature exceptions

2017-10-07 Thread Hans Hagen

On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:

On 10/07/2017 01:25 PM, Henning Hraban Ramm wrote:

I rejoiced too early:
While the ligature exception handling works with some of the default
fonts (lm, termes, pagella), it fails with the Alegreya fonts that I’m
using.


forget about Algreya as it's a useless font ... it has no kerns, no 
ligatures, no features at all so the f an whatever follows will always 
touch or overlap due to the design


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] Strange behavior with TikZ

2017-10-07 Thread Fabrice Couvreur
Hi,
Thank you so much for this help, I would not have found it.
Fabrice

2017-10-07 15:59 GMT+02:00 Hans Hagen :

> On 10/7/2017 2:44 PM, Aditya Mahajan wrote:
>
>> On Sat, 7 Oct 2017, Aditya Mahajan wrote:
>>
>> On Sat, 7 Oct 2017, Fabrice Couvreur wrote:
>>>
>>> Hi Hans
 Sorry to insist, but I need to correct this anomaly for my documents
 that

>>> I
>>>
 give to students. If I compile with Context Standalone, it does not
 work,
 but maybe I do not do what you are suggesting :

>>>
>>> I can confirm that color leakage. It happens due to pgfplots (and not
>>> tikz).
>>>
>>
>> I use tikz/pgfplots extensively and started wondering why I don't see
>> this error. Then I realized that I use a modified definition of
>> starttikzpicture in my code:
>>
>> \define\starttikzpicture
>>  {\hbox\bgroup\forcecolorhack\tikzpicture}
>>
>> \define\stoptikzpicture
>>  {\endtikzpicture\egroup}
>>
>>
>> With this definition, you code works correctly.
>>
> yes, i thought that was already done so someone needs to get that into the
> official code base
>
> (btw, it seems that there is also a \stopmodule done without \startmodule
> when tikz is loaded)
>
> Hans
>
> -
>   Hans Hagen | PRAGMA AD
> 
> E
>   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/list
> info/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] ligature exceptions

2017-10-07 Thread Henning Hraban Ramm
Am 2017-10-07 um 21:21 schrieb Pablo Rodriguez :

> Both Alegreya and Brill don’t replace the ligature with a single glyph,
> but replace the first glyph (only, as far as I know).
> 
> I don’t know which is the way to solve it, but this might be the cause.

Oh, yes. Thanks for the analysis. I get the startligature-f also on 
hyphenation, like in auf-fällig, so that the arc of the first f (that is 
supposed to touch the second) reaches over the hyphen.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-10-07 Thread Pablo Rodriguez
On 10/07/2017 01:25 PM, Henning Hraban Ramm wrote:
> I rejoiced too early:
> While the ligature exception handling works with some of the default
> fonts (lm, termes, pagella), it fails with the Alegreya fonts that I’m
> using.

The Brill fonts don’t work either (http://www.brill.com/about/brill-fonts).

\definefontfamily[mainfont][rm][Alegreya]
\definefontfamily[otherfont][rm][Brill]
\setupbodyfont [mainfont,16pt]

\starttext
\startTEXpage[offset=1em]
\startbuffer
falsch: Auflage Kampffront

richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

\setreplacements[eka]
richtig: Auflage Kampffront

f ft fl fk fb ff

f f\/t f\/l f\/k f\/b f\/f
\resetreplacements
\stopbuffer

\getbuffer

\setupbodyfont[times]\getbuffer

\setupbodyfont[otherfont]\getbuffer
\stopTEXpage
\stoptext

Both Alegreya and Brill don’t replace the ligature with a single glyph,
but replace the first glyph (only, as far as I know).

I don’t know which is the way to solve it, but this might be the cause.

Just in case it helps,

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] Strange behavior with TikZ

2017-10-07 Thread Hans Hagen

On 10/7/2017 2:44 PM, Aditya Mahajan wrote:

On Sat, 7 Oct 2017, Aditya Mahajan wrote:


On Sat, 7 Oct 2017, Fabrice Couvreur wrote:


Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents 
that 

I
give to students. If I compile with Context Standalone, it does not 
work,

but maybe I do not do what you are suggesting :


I can confirm that color leakage. It happens due to pgfplots (and not 
tikz).


I use tikz/pgfplots extensively and started wondering why I don't see 
this error. Then I realized that I use a modified definition of 
starttikzpicture in my code:


\define\starttikzpicture
     {\hbox\bgroup\forcecolorhack\tikzpicture}

\define\stoptikzpicture
     {\endtikzpicture\egroup}


With this definition, you code works correctly.
yes, i thought that was already done so someone needs to get that into 
the official code base


(btw, it seems that there is also a \stopmodule done without 
\startmodule when tikz is loaded)


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] Strange behavior with TikZ

2017-10-07 Thread Aditya Mahajan

On Sat, 7 Oct 2017, Aditya Mahajan wrote:


On Sat, 7 Oct 2017, Fabrice Couvreur wrote:


Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents that 

I

give to students. If I compile with Context Standalone, it does not work,
but maybe I do not do what you are suggesting :


I can confirm that color leakage. It happens due to pgfplots (and not 
tikz).


I use tikz/pgfplots extensively and started wondering why I don't see this 
error. Then I realized that I use a modified definition of 
starttikzpicture in my code:


\define\starttikzpicture
{\hbox\bgroup\forcecolorhack\tikzpicture}

\define\stoptikzpicture
{\endtikzpicture\egroup}


With this definition, you code works correctly.

Aditya
___
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] Strange behavior with TikZ

2017-10-07 Thread Aditya Mahajan

On Sat, 7 Oct 2017, Fabrice Couvreur wrote:


Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents that I
give to students. If I compile with Context Standalone, it does not work,
but maybe I do not do what you are suggesting :


I can confirm that color leakage. It happens due to pgfplots (and not 
tikz). Here is the smallest example I could come up with that shows the 
color leakage (the text is also colored magenta).


\usemodule[pgfplots]

\setuphead
   [section]
   [color=magenta]

\starttext
\startsection[title={Test}]

\startplacefigure[location={none,right}]
  \hbox{\starttikzpicture
\startaxis
[
  xmax=3, xmin=-3,
  ymax=4, ymin=-5,
]
\stopaxis
  \stoptikzpicture}
\stopplacefigure

\input knuth

\stopsection
\stoptext

Aditya
___
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] ligature exceptions

2017-10-07 Thread Henning Hraban Ramm
I rejoiced too early:
While the ligature exception handling works with some of the default fonts (lm, 
termes, pagella), it fails with the Alegreya fonts that I’m using.
I’d be glad if someone (you?) could look into my attached typescript file or 
even try downloading the fonts* to check what’s going on.

*) 
https://fonts.google.com/?selection.family=Alegreya|Alegreya+SC|Alegreya+Sans|Alegreya+Sans+SC

\mainlanguage[de]

%\usetypescriptfile [type-alegreya]
%\usetypescript [alegreya-light]
%\setupbodyfont [alegreya,rm,16pt]
\setupbodyfont  [termes,rm,16pt]

\definefontfeature[default]
[mode=node,kern=yes,
liga=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]

\replaceword[eka][Auflage][Au{fl}age]
\replaceword[eka][Kampffront][Kamp{ff}ront]

\starttext
falsch: Auflage Kampffront

richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

\setreplacements[eka]
richtig: Auflage Kampffront
\stoptext



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


type-alegreya.tex
Description: Binary data
___
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] Strange behavior with TikZ

2017-10-07 Thread Fabrice Couvreur
Hi Hans
Sorry to insist, but I need to correct this anomaly for my documents that I
give to students. If I compile with Context Standalone, it does not work,
but maybe I do not do what you are suggesting :


\placefigure[none,right]{}{%
\hbox{\switchtobodyfont[8pt]

Thanks
Fabrice

2017-10-05 22:51 GMT+02:00 Fabrice Couvreur :

> HI Hans,
>
> like this ?
>
> \placefigure[none,right]{}{
> \hbox{\switchtobodyfont[8pt]%
>
> Fabrice
>
> 2017-10-05 22:35 GMT+02:00 Hans Hagen :
>
>> On 10/5/2017 7:26 PM, Fabrice Couvreur wrote:
>>
>> If I put any image, there is no problem : the title of the section is in
>>> color and the text in black.
>>> With a graphic made with TikZ, the title and the text are in color.
>>>
>>
>> looks ok here
>>
>> \placefigure[none,right]{}{
>>> \hbox{\switchtobodyfont[8pt]
>>>
>>
>> add a % after the above line (otherwise you get a space)
>>
>> -
>>   Hans Hagen | PRAGMA ADE
>>   Ridderstraat 27 | 8061 GH Hasselt | The N
>> 
>> etherlands
>>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/list
>> info/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
___