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

Pablo Rodriguez oinos at gmx.es
Fri Dec 7 19:54:46 CET 2018


Dear list,

I’m experiencing a weird issue with optical bounds in OpenType.

Here you have the mandatory sample (font avaiable at
https://gitlab.com/ousia/greek-lfbd/raw/master/TypographicaOStandard-Regular.otf):

    \startluacode
    fonts.handlers.otf.addfeature {
        name = "leftbounds",
        type = "single",
        data = {
            Ἀ = { -32, 0, -32, 0 },
            Ἁ = { -32, 0, -32, 0 },
            Ἂ = { -70, 0, -70, 0 },
            Ἃ = { -70, 0, -70, 0 },
            Ἄ = { -50, 0, -50, 0 },
            Ἅ = { -50, 0, -50, 0 },
            Ἇ = { -42, 0, -42, 0 },
            Ἆ = { -42, 0, -42, 0 },
            Ἠ = { -212, 0, -212, 0 },
            Ἡ = { -212, 0, -212, 0 },
            Ἢ = { -258, 0, -258, 0 },
            Ἣ = { -258, 0, -258, 0 },
            Ἥ = { -286, 0, -286, 0 },
            Ἤ = { -286, 0, -286, 0 },
            Ἦ = { -246, 0, -246, 0 },
            Ἧ = { -246, 0, -246, 0 },
            Ὧ = { -196, 0, -196, 0 },
        }
    }
    \stopluacode
    \enabletrackers[fonts.protrusion]
    \definefontfeature[default][default]
        [script=greek, protrusion=quality, opbd=yes]
    \definefontfeature[leftbounds][leftbounds=yes]
    \showframe
    \setuplayout[page]
    \definefontfamily[mainface][rm][Typographica Old Standard]
    \definefontfamily[mainface][tt][Latin Modern Mono]
    \setupbodyfont[mainface, 300pt]
    \setupalign[hanging]
    \startbuffer
        \ifnum\pagenumber=1{\ttxx opbd}\else{\ttxx -opbd}\fi\page
        Ω\\
        Ὧ\\
        Α\\Ἀ\\Α\\Ἁ\\Α\\Ἂ\\Α\\Ἃ\\Α\\Ἄ\\Α\\Ἅ\\Α\\Ἆ\\Α\\Ἇ\\
        Ἠ\\Η\\Ἡ\\Η\\Ἢ\\Η\\Ἣ\\Η\\Ἤ\\Η\\Ἥ\\Η\\Ἦ\\Η\\Ἧ\\Η
    \stopbuffer
    \starttext
    \getbuffer

    \setupalign[nothanging]
    \feature[+][leftbounds]
    \getbuffer
    \stoptext

OpenType optical bounds are read from the font right:

    fonts           > protrusions > left factor 1, right factor 1
    fonts           > protrusions > setting left using lfbd
    fonts           > protrusions > lfbd -> 0.032 Ἀ (U+01F08)
    fonts           > protrusions > lfbd -> 0.032 Ἁ (U+01F09)
    fonts           > protrusions > lfbd -> 0.070 Ἂ (U+01F0A)
    fonts           > protrusions > lfbd -> 0.070 Ἃ (U+01F0B)
    fonts           > protrusions > lfbd -> 0.050 Ἄ (U+01F0C)
    fonts           > protrusions > lfbd -> 0.050 Ἅ (U+01F0D)
    fonts           > protrusions > lfbd -> 0.042 Ἆ (U+01F0E)
    fonts           > protrusions > lfbd -> 0.042 Ἇ (U+01F0F)
    fonts           > protrusions > lfbd -> 0.196 Ὧ (U+01F6F)
    fonts           > protrusions > lfbd -> 0.246 Ἧ (U+01F2F)
    fonts           > protrusions > lfbd -> 0.286 Ἦ (U+01F2E)
    fonts           > protrusions > lfbd -> 0.246 Ἥ (U+01F2D)
    fonts           > protrusions > lfbd -> 0.258 Ἤ (U+01F2C)
    fonts           > protrusions > lfbd -> 0.286 Ἣ (U+01F2B)
    fonts           > protrusions > lfbd -> 0.258 Ἢ (U+01F2A)
    fonts           > protrusions > lfbd -> 0.212 Ἡ (U+01F29)
    fonts           > protrusions > lfbd -> 0.212 Ἠ (U+01F28)

I’m afraid that they aren’t applied accurately.

The same values are used with the property "leftbounds" and they are
perfect in that feature.

Shouldn’t be the output from both methods be exactly the same?

In all glyph pairs, both accented and unaccented glyphs should end in
exactly the same point.

I think this may be a bug, although I may be missing something.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk




More information about the ntg-context mailing list