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]

\setupalign[hz,hanging]

\showmakeup[line]

\showglyphs

\startbuffer
Here is a line of text, the first sentence in the demonstration.\\
{\em Then} the next sentence in the paragraph follows.\\
You can see that the italic {\em T} appears to be a bit indented.\\
{\em There } might be a way to shift it to the left that little bit.\\
Perhaps a protrusion setting.\\
{\em This} does appear to depend to on the font used. With Modern and\\
Libertinus it is worse, with Times a bit better.
\blank
\stopbuffer

\starttext
Modern\\
\getbuffer
Times\\
\setupbodyfont[times]
\getbuffer
TLibertinus\\
\setupbodyfont[libertinus]
\getbuffer
\stoptext

/Mikael

On Mon, Nov 4, 2024 at 2:34 AM Rik Kabel <cont...@rik.users.panix.com> wrote:
>
> In a paper I recently wrote I noticed some ugly zigzag alignment on the left 
> margin of one paragraph (set with Libertinus) where a couple of book titles 
> appeared at the start of the second and fourth lines. The following example 
> demonstrates the issue.
>
> \definefontfeature [default]
>                    [default]
>                    [protrusion=quality,expansion=quality]
> \setupalign        [hz,hanging]
>
> \startbuffer
> Here is a line of text, the first sentence in the demonstration.\\
> {\em Then} the next sentence in the paragraph follows.\\
> You can see that the italic {\em T} appears to be a bit indented.\\
> {\em There } might be a way to shift it to the left that little bit.\\
> Perhaps a protrusion setting.\\
> {\em This} does appear to depend to on the font used. With Modern and\\
> Libertinus it is worse, with Times a bit better.
> \blank
> \stopbuffer
>
> \starttext
> Modern\\
> \getbuffer
> Times\\
> \setupbodyfont[times]
> \getbuffer
> Libertinus\\
> \setupbodyfont[libertinus]
> \getbuffer
> \stoptext
>
> How can one set a small left-margin protrusion for the italic T and possibly 
> other characters? I know it is a small issue, but once seen it is hard to 
> un-see.
>
> --
> Rik
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to