ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Modifying potrusion parameters
@ 2011-11-06 12:52 Simonyi András
  2011-11-06 13:18 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Simonyi András @ 2011-11-06 12:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear ConTeXt-ers,

I am using protrusion and char. expansion for a book project (with
MKIV from the latest ConTeXt minimal), and it works wonderfully, with
the exception of a minor problem: I find the preset protrusion
parameters for  "guillemets" (double angle quotes)  which occur
frequently in my (Italian) text
too large, and would like to modify them.  Relying on the wiki and
mailing-list posts, I realised that the parameters are set in the file
font-ext.lua, but changing this file seems to have no effect on the
typesetting. How should I rebuild/recompile ConTeXt in order to
"apply" my changes?

I am a novice ConTeXt  user, so please forgive me if my question is trivial.

Thanks in advance for your help and best wishes,

András Simonyi, Budapest, Hungary
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modifying potrusion parameters
  2011-11-06 12:52 Modifying potrusion parameters Simonyi András
@ 2011-11-06 13:18 ` Hans Hagen
  2011-11-06 19:53   ` Simonyi András
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2011-11-06 13:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6-11-2011 13:52, Simonyi András wrote:
> Dear ConTeXt-ers,
>
> I am using protrusion and char. expansion for a book project (with
> MKIV from the latest ConTeXt minimal), and it works wonderfully, with
> the exception of a minor problem: I find the preset protrusion
> parameters for  "guillemets" (double angle quotes)  which occur
> frequently in my (Italian) text
> too large, and would like to modify them.  Relying on the wiki and
> mailing-list posts, I realised that the parameters are set in the file
> font-ext.lua, but changing this file seems to have no effect on the
> typesetting. How should I rebuild/recompile ConTeXt in order to
> "apply" my changes?
>
> I am a novice ConTeXt  user, so please forgive me if my question is trivial.

There is no need to change that file, just make a new vector in your style.

\startluacode

local classes = fonts.protrusions.classes
local vectors = fonts.protrusions.vectors

classes.myown = {
     vector = 'myown',
     factor = 1,
}

vectors.myown = table.merged (vectors.quality, {
     [0x002C] = { 0, 2 }, -- comma
})

\stopluacode

\starttext

\showframe

\definefontfeature[whatever][default][protrusion=quality]

\definedfont[Serif*whatever] \setupalign[hanging] \input tufte

\definefontfeature[whatever][default][protrusion=myown]

\definedfont[Serif*whatever] \setupalign[hanging] \input tufte

\stoptext


-----------------------------------------------------------------
                                           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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modifying potrusion parameters
  2011-11-06 13:18 ` Hans Hagen
@ 2011-11-06 19:53   ` Simonyi András
  0 siblings, 0 replies; 3+ messages in thread
From: Simonyi András @ 2011-11-06 19:53 UTC (permalink / raw)
  To: Hans Hagen, ntg-context

Dear Hans,
thanks a lot, your Lua code did the trick.

with best wishes,
Andras

2011/11/6 Hans Hagen <pragma@wxs.nl>:
> On 6-11-2011 13:52, Simonyi András wrote:
>>
>> Dear ConTeXt-ers,
>>
>> I am using protrusion and char. expansion for a book project (with
>> MKIV from the latest ConTeXt minimal), and it works wonderfully, with
>> the exception of a minor problem: I find the preset protrusion
>> parameters for  "guillemets" (double angle quotes)  which occur
>> frequently in my (Italian) text
>> too large, and would like to modify them.  Relying on the wiki and
>> mailing-list posts, I realised that the parameters are set in the file
>> font-ext.lua, but changing this file seems to have no effect on the
>> typesetting. How should I rebuild/recompile ConTeXt in order to
>> "apply" my changes?
>>
>> I am a novice ConTeXt  user, so please forgive me if my question is
>> trivial.
>
> There is no need to change that file, just make a new vector in your style.
>
> \startluacode
>
> local classes = fonts.protrusions.classes
> local vectors = fonts.protrusions.vectors
>
> classes.myown = {
>    vector = 'myown',
>    factor = 1,
> }
>
> vectors.myown = table.merged (vectors.quality, {
>    [0x002C] = { 0, 2 }, -- comma
> })
>
> \stopluacode
>
> \starttext
>
> \showframe
>
> \definefontfeature[whatever][default][protrusion=quality]
>
> \definedfont[Serif*whatever] \setupalign[hanging] \input tufte
>
> \definefontfeature[whatever][default][protrusion=myown]
>
> \definedfont[Serif*whatever] \setupalign[hanging] \input tufte
>
> \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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-06 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-06 12:52 Modifying potrusion parameters Simonyi András
2011-11-06 13:18 ` Hans Hagen
2011-11-06 19:53   ` Simonyi András

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).