ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mikael Sundqvist <mickep@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 07:35:33 +0100	[thread overview]
Message-ID: <CAHy-LL-s-9Vu-q6rXfvKvA4xtQBtOZ-fZSDpaLP2Lha7o2dcWw@mail.gmail.com> (raw)
In-Reply-To: <9169ea95-51e5-4fd3-ae09-076037570800@rik.users.panix.com>

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 <ConTeXt@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	other threads:[~2024-11-04  6:39 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 ` Mikael Sundqvist [this message]
2024-11-04 15:51   ` [NTG-context] " 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

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=CAHy-LL-s-9Vu-q6rXfvKvA4xtQBtOZ-fZSDpaLP2Lha7o2dcWw@mail.gmail.com \
    --to=mickep@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).