3

How could I get more control handling the "hanging" option for hyphenation with optical margins provided by \setupalign[hanging]? That is to say, I am not worried about protrusion. The default "hz" option of ConTeXt is enough for me. I know that there is no accounting for taste, but "hanging" seems to me visually good with the hyphens of some fonts, and not so good whit others.

The default internal settings from simply "hanging" may be good for many but not for my aesthetic preferences.

For me, it is only a point about tastes with the displacement towards the margins, but only with the hyphenation glyphs. I am speaking all the time about the hyphenations, not about the hold protrusion.

This is too much projection towards the right margin in my opinion. But, anyway, I insist: I know that are different strokes for different folks.

Apart from that, the protrusion within the lines is fine for my tastes.

  • It might help to define what you consider "flexible" and provide an example that illustrates "counter-productive" results and how it "wrecks" the advantages. I assume you probably looked at it already, but the Wiki page (wiki.contextgarden.net/Protrusion) does highlight some options like hz adjustments. – ssokolen Jul 24 '18 at 19:51
  • You can define your own protrusion vectors in Lua, see “8.8 Protrusion” in Fonts out of ConTeXt. To me it's not really clear what you are asking. Do you have a concrete example where you think default settings for protrusion fail and a clear vision of what it should be instead? – Henri Menke Jul 24 '18 at 21:41
  • @ebohoyod You should elaborate what “many times it looks too much marked” means, supported by an example. Otherwise the answer to your question “Is there any tweak...?” is simply “Yes.” Those kinds of yes-no questions are generally discouraged on this site, see What types of questions should I avoid asking? – Henri Menke Jul 24 '18 at 23:00
  • 1
    Ah, I see your problem. It is unfortunate that the protrusion settings are defined in terms of the em-width of the font, because when the hyphen is rather short compared to the em-width you get this effect of extreme hanging. But as for any font-related dimension, one size never fits all. – Henri Menke Jul 25 '18 at 0:21
  • 1
    @HenriMenke Thanks again. Now, my question is formally solved ;) – ebohoyod Sep 16 '18 at 20:46
6

As outlined in “8.8 Protrusion” in Fonts out of ConTeXt you can easily construct your own protrusion vectors. Here I use the quality vector but change the protrusion settings for the hyphen (default of the punctuation vector which is used by the quality vector is { 0, 0.70 })

\startluacode
fonts.protrusions.vectors.ebohoyod = table.merged(
    fonts.protrusions.vectors.quality,
    {
        [0x002D] = { 0, 0.25 }, -- hyphen
    }
)
\stopluacode
\setupfontprotrusion[ebohoyod][vector=ebohoyod]

\definefontfeature
  [quality]
  [default]
  [protrusion=quality]

\definefontfeature
  [ebohoyod]
  [default]
  [protrusion=ebohoyod]

\definefont[First][file:Sukhumala-Regular.otf*quality]
\definefont[Second][file:Sukhumala-Regular.otf*ebohoyod]

\setupalign[hanging]

\starttext

\startoverlay
  {\ruledvbox{\color[gray]{\First\input knuth\par}}}
  {\ruledvbox{\Second\input knuth\par}}
\stopoverlay

\stoptext

In the background is the original quality protrusion setting (light gray). Maybe 0.25 is too little margin kerning...

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.