[NTG-context] issue with optical bounds (OpenType)

Hans Hagen j.hagen at xs4all.nl
Sun Dec 9 14:22:21 CET 2018


On 12/9/2018 1:34 PM, Pablo Rodriguez wrote:
> On 12/7/18 11:25 PM, Hans Hagen wrote:
>> On 12/7/2018 9:14 PM, Pablo Rodriguez wrote:
>>> [...]
>>> The issue is that, although opbd values are used, that results from opbd
>>> and from single placement in addfeature are different (although LuaTeX
>>> reports the same values for lfbd).
>>
>> because you implement it as kerning and not as opbd (protrusion is not
>> kerning) ... you can try to change the name to "lfbd" (if you would
>> enable lfbd as feature for sure you would get funny kerning so opbd
>> picks up from those instead)
> 
> If protrusion has to apply other values than the ones besides opbd, the
> values for optical bounds aren’t reliable for accurate glyph
> positioning. Sorry, but otherwise there is no need for optical margins
> in OpenType (standard protrusion would be all that is needed).
> 
> Kerning might be selectively applied, such as in:
> 
>      \startluacode
>      fonts.handlers.otf.addfeature {
>          name = "leftbounds",
>          type = "single",
>          data = {
>              Ἠ = { -212, 0, -212, 0 },
>              Ὧ = { -196, 0, -196, 0 },
>          }
>      }
>      \stopluacode
>      \definefontfeature[default][default][protrusion=quality]
>      \definefontfeature[leftbounds][leftbounds=yes]
>      \setupfirstline
>         [alternative=word, n=1, style={\feature[+][leftbounds]}]
>      \showframe
>      \setuplayout[page]
>      \definefontfamily[mainface][rm][Typographica Old Standard]
>      \definefontfamily[mainface][tt][Latin Modern Mono]
>      \setupbodyfont[mainface, 300pt]
>      \setupalign[hanging]
>      \startbuffer
>          «a\par
>          «b\par
>          Ω\par
>          Ὧ\par
>          Ἠ\par
>      \stopbuffer
>      \starttext
>          \setupparagraphintro[each][\setfirstline]
>          \getbuffer
>      \stoptext
> 
> At least to get Greek hanging diacritics, I think this is the way to go.
> It would be extremely useful to enable a \setuplineintro for verse.
> 
> It would be also useful to have a function that substracts the width of
> two given glyphs. (This is exactly the amount to get hanging diacritics
> properly kerned.)
you confuse mechanism:

- protrusion only happen at the start and end of the line
- kerning (like single does) happens everywhere

so, you need to extend "lfbd" and not use some own kerning feature 
"leftbounds" which applyu it everywhere while "lfbd" is treated special 
i.e. sets the protrusion values (when "opbd" is enabled) ... no other 
way to do this

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list