Discussion:
[NTG-context] issue with optical bounds (OpenType)
Pablo Rodriguez
2018-12-07 18:54:46 UTC
Permalink
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


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-***@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
____________________________________
Hans Hagen
2018-12-07 19:15:21 UTC
Permalink
Post by Pablo Rodriguez
Shouldn’t be the output from both methods be exactly the same?
maybe you need to choose a script and/or language

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-***@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
_________________________________________________________
Pablo Rodriguez
2018-12-07 20:14:28 UTC
Permalink
Post by Hans Hagen
Post by Pablo Rodriguez
Shouldn’t be the output from both methods be exactly the same?
maybe you need to choose a script and/or language
Many thanks for your reply, Hans.

I modified the font myself and the Greek script is required and selected
(with the Latin script, that OT opbd property doesn’t work at all).

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).

Just in case it helps,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-***@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
____________________________________________________
Hans Hagen
2018-12-07 22:25:03 UTC
Permalink
Post by Pablo Rodriguez
Post by Hans Hagen
Post by Pablo Rodriguez
Shouldn’t be the output from both methods be exactly the same?
maybe you need to choose a script and/or language
Many thanks for your reply, Hans.
I modified the font myself and the Greek script is required and selected
(with the Latin script, that OT opbd property doesn’t work at all).
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)


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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-***@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
_____________________________

Loading...