ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Steffen Wolfrum <context@st.estfiles.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: hz off?
Date: Mon, 23 Nov 2009 10:52:57 +0100	[thread overview]
Message-ID: <D528954E-F058-4461-AB55-CAF5A365E5FC@st.estfiles.de> (raw)
In-Reply-To: <8C6D1459-6F3B-43C3-8553-DF4085B20E6D@uni-bonn.de>

And what's the way to define your own protrusion?

Shouldn't it go like this?


\showframe

\startluacode
fonts.protrusions.vectors['MyVector'] = {

    [0x2044] = { 0, 0.50    }, -- fraction slash
    [0x002f] = { 0, 0.50    }, -- solidus slash
    [0x002C] = { 0, 0.50    }, -- comma
    [0x002E] = { 0, 0.50    }, -- period
    [0x003A] = { 0, 0.50    }, -- colon
    [0x003B] = { 0, 0.50    }, -- semicolon
    [0x002D] = { 0, 0.50    }, -- hyphen
    [0x2013] = { 0, 0.25 }, -- endash
    [0x201C] = { 0, -1.25    }, -- quotedblleft

}
fonts.protrusions.classes['Mypure'] = {
    vector = 'MyVector', factor = 1
}

fonts.expansions.classes['Myquality'] = {
    stretch = 1, shrink = 1, step = .5, vector = 'default', factor = 1
}
\stopluacode


\definefontfeature[default][default][mode=node,expansion=Myquality,protrusion=Mypure]

\usetypescript[palatino]
\setupbodyfont[palatino]

\setupalign[hz,hanging]

\enableprotruding
\enableadjusting


\starttext

\input knuth

\stoptext




Steffen



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


  parent reply	other threads:[~2009-11-23  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  9:31 Steffen Wolfrum
2009-11-23  9:40 ` Thomas A. Schmitz
2009-11-23  9:45   ` Hans Hagen
2009-11-23  9:52   ` Steffen Wolfrum [this message]
2009-11-23 10:07     ` Hans Hagen
2009-11-23 10:16       ` Steffen Wolfrum
2009-11-23 10:50         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D528954E-F058-4461-AB55-CAF5A365E5FC@st.estfiles.de \
    --to=context@st.estfiles.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).