From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Zigzag left margin with italics
Date: Mon, 4 Nov 2024 23:10:26 +0100 [thread overview]
Message-ID: <8e61ddd6-f580-00cb-27f6-0d9db9842f8e@gmail.com> (raw)
In-Reply-To: <bcfb6e30-65c6-49c2-b5fc-251f8837771f@xs4all.nl>
Hans Hagen schrieb am 04.11.2024 um 18:54:
> On 11/4/2024 6:39 PM, Rik Kabel wrote:
>>
>> On 2024-11-04 10:55, Wolfgang Schuster wrote:
>>> Mikael Sundqvist schrieb am 04.11.2024 um 07:35:
>>>> Hi,
>>>>
>>>> You can try this below (from test suite), but then, as you see, also
>>>> upright T will move out. Not sure how/if you can control that.
>>>>
>>>> \startluacode
>>>>
>>>> local classes = fonts.protrusions.classes
>>>> local vectors = fonts.protrusions.vectors
>>>>
>>>> classes.rik = {
>>>> vector = 'rik',
>>>> factor = 1,
>>>> }
>>>>
>>>> vectors.rik = table.merged (
>>>> vectors.quality,
>>>> {
>>>> [0x0054] = { 0.35, 0 }, -- T
>>>> })
>>>>
>>>> \stopluacode
>>>>
>>>> \definefontfeature
>>>> [default]
>>>> [default]
>>>> [protrusion=rik,expansion=quality]
>>>
>>> Define a feature which sets only the custom protrusion values:
>>>
>>> \definefontfeature [rik] [protrusion=quality]
>>>
>>> and create a new typeface where you apply the new feature to the
>>> italic/slanted style:
>>>
>>> \definefontfamily [riktimes] [rm] [TeX Gyre Termes] [sl=features:
>>> {default,rik}]
>>>
>>> Afterwards use \seupbodyfont[riktimes] to access the new typeface.
>>>
>>> Wolfgang
>>> ___________________________________________________________________________________
>>>
>>
>> Looking a bit more, the problem is not protrusion but the bounding
>> box. Look at the left side of the italic T and W, and to a lesser
>> degree C, O, and Q, produced by the following.
>>
>> \usetypescript[libertinus]
>> \setupbodyfont[libertinus]
>> \starttext
>> ¦\doloopoverlist{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
>> {\it\recursestring\tf¦}\par
>> ¦\doloopoverlist{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
>> {\recursestring¦}
>>
>> ¦\doloopoverlist{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
>> {\WORD{\it\recursestring}\tf¦}\par
>> ¦\doloopoverlist{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
>> {\WORD{\recursestring}¦}
>> \stoptext
>>
>> This may be an issue for the font maintainer, but is there anything
>> that could be done within context?
>
> you can make a font goodie file where you patch properties of a specific
> glyph but then you also need to keep an eye on when the font gets fixed
A simple solution is to use \shapecorrection which moves the slanted
glyphs closer the margins of the text block.
%%%% begin example
\setuppapersize[A5]
\startbuffer
H\crlf
{\it T}
\blank
H\crlf
{\shapecorrection[both]\it T}
\stopbuffer
\showframe
\starttext
\subject{Latin Modern}
\getbuffer
\setupbodyfont[times]
\subject{Times}
\getbuffer
\setupbodyfont[libertinus]
\subject{Libertinus}
\getbuffer
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2024-11-04 22:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 1:34 [NTG-context] " Rik Kabel
2024-11-04 6:35 ` [NTG-context] " Mikael Sundqvist
2024-11-04 15:51 ` Rik Kabel
2024-11-04 15:55 ` Wolfgang Schuster
2024-11-04 17:39 ` Rik Kabel
2024-11-04 17:54 ` Hans Hagen
2024-11-04 21:49 ` Rik Kabel
2024-11-04 22:10 ` Wolfgang Schuster [this message]
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=8e61ddd6-f580-00cb-27f6-0d9db9842f8e@gmail.com \
--to=wolfgang.schuster.lists@gmail.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).