simoncozens / fontFeatures

Python library for manipulating OpenType font features
BSD 3-Clause "New" or "Revised" License
73 stars 10 forks source link

otf2fea: diffenator reports that the new OTF file has kerns missing + more #36

Open marekjez86 opened 3 years ago

marekjez86 commented 3 years ago
  1. I took https://github.com/googlefonts/noto-source/tree/master/src/NotoSansKhojki and build an OTF file https://github.com/googlefonts/noto-fonts/blob/master/unhinted/otf/NotoSansKhojki/NotoSansKhojki-Regular.otf

  2. I ran otf2fea of the OTF file to extract new fea; I also modified the source to use this fea obtaining the sources contained in this zip file
    NotoSansKhojki.zip

  3. I build a new OTF using fontmake

  4. I compared the new OTF with the previous OTF expecting that they would be virtually the same, but they weren't (see the results of tools below)

  5. the diffenator listed differences as follows (are these differences acceptable in the new font)? :

glyphs new: 6

glyph area string
KHA.alt 114257 𑈉𑈯
U.alt 96129 𑈣‍𑈵𑈦𑈯
U.alt2 52147 𑈔𑈯
U.alt3 71692 ‍𑈵𑈥𑈯
YA.alt2 124373 𑈞‍𑈵𑈥
YA.alt3 112674 𑈐‍𑈵𑈥

glyphs missing: 2

glyph area string
KHA.alt 114257 𑈉𑈭
YA.alt3 112674 ‍𑈵𑈥𑈭

kerns missing: 4

left right value string
kj_GGA U.alt 170 𑈋
BHRA U.alt 160 𑈣‍𑈵𑈦
kj_DHA U.alt 160 𑈝
MRA U.alt 160 𑈤‍𑈵𑈦

metrics modified: 1

glyph diff_adv
U.alt3 260.0

gdef_base missing: 132

glyph
DDII
YU
kj_AU
kj_AA
PHII
PHI
kj_YA
DDU
kj_DDA
DII
JJU
DI
LLII
BU
kj_BA
RI
kj_A
kj_AI
RII
kj_NNA
NNU
KHU
kj_THA
THA.alt
kj_JJA
kj_DHA
kj_GHA
BHRA
THU
DDDII
DU
SRA
SA.alt
kj_SA
kj_CHA
GHU
NGU
DDHU
JU
PHU
CHU
KRA
kj_KA
KU
MRA
kj_MA
MU
kj_DDHA
kj_PHA
BHU

gdef_mark missing: 20

glyph
U.alt3
Nukta_Shadda_AI.... Nukta_AI.ns
Anusvara
Nukta_Shadda_E.n... AI_Shadda.ns
Nukta_E.ns
Shadda
Nukta.alt
kj_vs_U.ns
Anusvara.alt
I.alt4
kj_vs_AI.ns
Nukta_Shadda.ns
kj_vs_E.ns
NullMark
E_Shadda.ns
Ra_U
Nukta
RA.alt

NotoSansKhojki-20210223-1522.zip

simoncozens commented 3 years ago

Changing the fonts features cannot have changed the outline or metrics of the glyphs, so that is not related to fontFeatures - you will need to debug that one yourself. The GDEF issue is the same as #35; I will fix that. ~In the meantime you could try passing the --no-gdef option to otf2fea to make fontmake figure out the GDEF entries itself.~ (Scratch that, I'm getting confused between otf2fea and fee2fea.)

davelab6 commented 3 years ago

@marekjez86 The diffenator report you quoted says, 

glyphs new: 6
glyph area string
KHA.alt 114257 𑈉𑈯 <--
U.alt 96129 𑈣‍𑈵𑈦𑈯
U.alt2 52147 𑈔𑈯
U.alt3 71692 ‍𑈵𑈥𑈯
YA.alt2 124373 𑈞‍𑈵𑈥
YA.alt3 112674 𑈐‍𑈵𑈥 <--

glyphs missing: 2
glyph area string
KHA.alt 114257 𑈉𑈭 <--
YA.alt3 112674 ‍𑈵𑈥𑈭 <--

Since the area calculations of the new and missing glyphs are identical, I guess maybe diffenator is buggy. I wonder if @m4rc1e can tell us a bit more about how the new/missing heuristic works and if such unexpected results are known possibilities.

marekjez86 commented 3 years ago

I'll follow up on @davelab6 suggestion to recompile all of the OTF files first with the current fontmake (some of the previous files were built about 2-4 months ago, so it's possible that it had fontmake issues still).

marekjez86 commented 3 years ago

@davelab6 @simoncozens : new and improved result from the diffenator (after --gdef and after recompiling the original sources)

glyphs new: 6

glyph area string
KHA.alt -114280 𑈉𑈯
U.alt -96318 𑈣‍𑈵𑈦𑈯
U.alt2 -52112 𑈔𑈯
U.alt3 -71809 ‍𑈵𑈥𑈯
YA.alt2 -124478 𑈞‍𑈵𑈥
YA.alt3 -112827 𑈐‍𑈵𑈥

glyphs missing: 2

glyph area string
KHA.alt -114280 𑈉𑈭
YA.alt3 -112827 ‍𑈵𑈥𑈭

kerns missing: 4

left right value string
kj_GGA U.alt 170 𑈋
BHRA U.alt 160 𑈣‍𑈵𑈦
MRA U.alt 160 𑈤‍𑈵𑈦
kj_DHA U.alt 160 𑈝

metrics modified: 1

glyph diff_adv
U.alt3 260.0

gdef_base new: 3

glyph
KHA.alt
YA.alt3
YA.alt2

gdef_base missing: 2

glyph
KHA.alt
YA.alt3

gdef_mark new: 3

glyph
U.alt2
U.alt3
U.alt

gdef_mark missing: 1

glyph
U.alt3

davelab6 commented 3 years ago

@marekjez86 nice progress!