ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rik Kabel <ConTeXt@rik.users.panix.com>
To: ntg-context@ntg.nl
Subject: Re: Adjust kern for one character
Date: Mon, 23 Dec 2019 18:45:25 -0500	[thread overview]
Message-ID: <bce1a040-d1b1-9ce4-eb7a-59d52ffa9afe@rik.users.panix.com> (raw)
In-Reply-To: <73379dce-058d-7f04-79ed-1ad555a970ea@gmail.com>


On 12/22/2019 21:34, Henri Menke wrote:
>
>
> On 12/23/19 3:33 PM, Henri Menke wrote:
>> On 12/23/19 2:30 PM, Rik Kabel wrote:
>>>
>>> On 12/22/2019 17:40, mf wrote:
>>>> Il 22/12/19 22:19, Rik Kabel ha scritto:
>>>>> List,
>>>>>
>>>>> Is there a way in ConTeXt to adjust the left-side kern for one
>>>>> character? The cap J in the font I am using is being set too close to
>>>>> the preceding characters and I would rather not insert a thinspace
>>>>> before each. (Inserting a thinspace is sufficient, but finer control
>>>>> is welcome.)
>>>>>
>>>> \definecharacterspacing[distantJ]
>>>> \setupcharacterspacing[distantJ]["004A][left=.15,alternative=1] % 004A
>>>> is the unicode hex index of letter J
>>>> \starttext
>>>>     normal: AJB\par
>>>>     \setcharacterspacing[distantJ] more space on the left: AJB\par
>>>>     \resetcharacterspacing normal again: AJB\par
>>>> \stoptext
>>>>
>>> Thank you for that, Massi.
>>>
>>> Unfortunately, that is too blunt an instrument in this case -- in
>>> addition to the body font where the problem exists, it works on the
>>> heading and titling font, which does not share the problem.
>>>
>>> As Henri's answer hints, I was a bit unclear in my request. It is a 
>>> kern
>>> between a word space and the cap J that is the issue. Perhaps a font
>>> feature file is the place to do such a thing.
>>
>> \startluacode
>> fonts.handlers.otf.addfeature {
>>       name = "kern",
>>       type = "kern",
>>       data = {
>>           [" "] = {
>>               ["J"] = 1000 % exaggerated value
>
> Should of course be a Lua comment
>
>             ["J"] = 1000 -- exaggerated value
>
>>           }
>>       }
>> }
>> \stopluacode
>>
>> \setupbodyfont[modern] % have to reload the font
>>
>> \starttext
>>
>> No Jokes!
>>
>> \stoptext
>>
Henri,

This looks very promising. It works, mostly. That is, all fonts that use 
default fontfeatures pick up the change. So, for example, the companion 
sansserif for my body font also gets it even though that is not what I want.

I can remove kerning from the default fontfeatures and add it back just 
for the problematic font, but that means no kerning for the sans font.

Is there a way to apply this to one font only (serif upright, bold, 
italic, ...) or even a single face (upright), perhaps by giving it a 
unique name? I have tried a few variations but had no success. The 
fonts-mkiv manual has very little on this, and the cld manual nothing.

-- 
Rik

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

  reply	other threads:[~2019-12-23 23:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-22 21:19 Rik Kabel
2019-12-22 21:28 ` Henri Menke
2019-12-23  9:13   ` Mojca Miklavec
2019-12-23  9:31     ` Hans Hagen
2019-12-22 22:40 ` mf
2019-12-23  1:30   ` Rik Kabel
2019-12-23  2:33     ` Henri Menke
2019-12-23  2:34       ` Henri Menke
2019-12-23 23:45         ` Rik Kabel [this message]
2019-12-26 12:41           ` Rik Kabel
2019-12-26 13:40             ` Hans Hagen
2019-12-26 14:34               ` Rik Kabel

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=bce1a040-d1b1-9ce4-eb7a-59d52ffa9afe@rik.users.panix.com \
    --to=context@rik.users.panix.com \
    --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).