Junicode-font icon indicating copy to clipboard operation
Junicode-font copied to clipboard

Crashes in InDesign

Open psb1558 opened this issue 2 years ago • 36 comments

In InDesign 18.5 (and at least one earlier version), Junicode VF causes crashes when changing instances. Currently only the italic face seems to be a problem. I'm going to record my attempts to find the bug here, starting from Junicode 2.000beta5 as baseline, and if anyone comes along with expertise in making fonts work with InDesign, I hope they'll join in.

  1. Found a naming anomaly, that one axis value was sometimes "Smbold" and sometimes "SmBold." Corrected that, but it made no difference.
  2. Noticing that Inter did without Postscript names for instances, I tried that. The crashing seemed to stop, but InDesign started changing Italic to roman whenever the axis sliders were used, so can't tell if it would have crashed. Am putting back the PostScript names.
  3. Roboto Flex includes elidable subfamily names in its PostScript names, but Source Serif 4 does not. Probably not worth trying a change here.

psb1558 avatar Aug 05 '23 13:08 psb1558

Still reading all my saved links about this. Three things are needed to work in InDesign.

  • PostScript nameID 25 names for the instances - you have that
  • STAT table AxisValue Format="2" - you have Format="1"
  • fvar table postscriptNameID must be unique

This last one I am still trying to figure-out exactly. This is an InDesign quirk/bug. Going to go look at Source Serif 4 and Inter 4 beta fvar tables now to check them.

kenmcd avatar Aug 05 '23 20:08 kenmcd

This is a working example: LibreCaslonText-format2.zip

Take a look at the postscriptNameID's in the fvar table. In the Roman font: LibreCaslonTextRoman-Regular LibreCaslonTextRoman-Medium In the Italic font: LibreCaslonTextItalic-Regular LibreCaslonTextItalic-Medium Etc...

The normal FamilyName-StyleName does not work.

EDIT: Hmm... Source Serif 4 looks a bit different... It has nameID 25 in the name table as the Variations PostScript Name Prefix. Roman = SourceSerif4Roman Italic = SourceSerif4Italic

Maybe that is all that is needed. Because the fvar names seem to match the other instance names.

kenmcd avatar Aug 05 '23 21:08 kenmcd

LibreCaslon also has the nameID 25 in the name table Roman = LibreCaslonTextRoman Italic = LibreCaslonTextItalic

And all the fvar names like In the Roman font: LibreCaslonTextRoman-Regular LibreCaslonTextRoman-Medium In the Italic font: LibreCaslonTextItalic-Regular LibreCaslonTextItalic-Medium etc...

kenmcd avatar Aug 05 '23 21:08 kenmcd

Hmmm... Junicode VF v2.000beta5 name table nameID 25 Roman = JunicodeVFRoman Italic = JunicodeVFItalic

So maybe all it needs is STAT table AxisValue Format="2"

kenmcd avatar Aug 05 '23 21:08 kenmcd

It used to have format 2, but then someone who had advised me about the STAT table before told me that it could take format 1 (see the post by Thomas Linard here). Source Serif 4 uses format 1, and it works fine (Source Sans 3, however, still uses Format 2). I also studied the Source Sans 4 PostScript names and copied they way they did it (Source Sans 3 does it the same way). The PostScript names all look fine to me, but I could easily be missing a typo (though I doubt it, since it's programmatically generated).

I'm onto another possiblity: font validator found a mismatch between maxComponentDepth in the maxp table and the actual component depth—the maxp value too low. That could cause a crash in some apps. I'm flattening it (depth never more than one) and will see if that makes a difference. I'll also check the maxp settings relating to hinting.

I'm fairly confident by now that the problem is neither the fvar nor the STAT table.

psb1558 avatar Aug 06 '23 01:08 psb1558

Another detail: the font when generated by Glyphs instead of fontmake does not cause a crash in the Adobe apps. It provides a useful point of comparison, particularly as Glyphs now produces a competent STAT table.

psb1558 avatar Aug 06 '23 01:08 psb1558

Well, the maxp table did need correcting, but it didn't solve the problem. InDesign is still crashing (with italic only). I'll see what happens if I restore Format 2 in the STAT table. It feels like a desperation move.

psb1558 avatar Aug 06 '23 02:08 psb1558

Source Serif 4 uses format 1

Hmm... today I was comparing Junicode v2.000beta5, Source Serif 4 v4.005 release (from the repo not the Google Fonts version which is different), and Inter v4.000beta9h. And both Source Serif 4 and Inter used Format 2.

kenmcd avatar Aug 06 '23 02:08 kenmcd

Inter was dealing with this same issue and one of the 3 fixes (as listed above) was to change to Format 2. There was also an overall format that had to be a particular one; will see if I can confirm that tomorrow.

There have been a lot of discussions among the GF folks about this - and I have saved them all - which is what I was going back through and reading today. Quite a few of those discussions involved Thomas Linard. And the accepted solution seems to have evolved, but there is still no clear written instructions anywhere.

So I think looking at a few more recently updated fonts would be useful. I think Fraunces recently updated and used Format 2. And it also has multiple axes. Think I saved the script they used. Should also look at Playfair 2. And perhaps Recursive.

kenmcd avatar Aug 06 '23 02:08 kenmcd

Interesting . . . I was looking at 4.004. So they went back to Format 2. I wonder why.

Anyway, I tried going back to Format 2 as well, but it's still crashing. I can't go on building all those static fonts when I'm just running tests (many tests!) on the variable fonts, so instead of building everything and tagging it, I'll leave a couple of Google Drive links, if you want to check out the current copy: italic and roman.

BTW, I have now tested in Firefox, Chrome, and Safari. No crashes or other problems there. It seems to be working perfectly everywhere but in Adobe.

psb1558 avatar Aug 06 '23 03:08 psb1558

OK. Will look at those tomorrow.

Another thought - the LibreCaslon format2 fonts that I attached above were made by Thomas Linard as an example of what works in InDesign (from one of those many discussions).

kenmcd avatar Aug 06 '23 03:08 kenmcd

Another detail: the font when generated by Glyphs instead of fontmake does not cause a crash in the Adobe apps. It provides a useful point of comparison, particularly as Glyphs now produces a competent STAT table.

We should compare these STAT tables. I am thinking it could be something related to the multiple axes.

That has been mentioned in the discussions. So I will see if there are any comments/ answers there. And we need to look at fonts with multiple axes which do work.

Roboto-Flex? I remember it has been discussed related to InDesign, but I don't remember if it works. The Fraunces WONK axis has been an issue in some browsers; again, do not remember if it works in ID. Recursive? Playfair 2? Have to find multi-axis fonts that work in ID.

kenmcd avatar Aug 06 '23 03:08 kenmcd

I'll try Roboto Flex in ID tomorrow. Meanwhile, here are the rival STAT tables. First from the Glyphs-generated Italic:

<STAT>
    <Version value="0x00010001"/>
    <DesignAxisRecordSize value="8"/>
    <!-- DesignAxisCount=4 -->
    <DesignAxisRecord>
      <Axis index="0">
        <AxisTag value="wght"/>
        <AxisNameID value="256"/>  <!-- Weight -->
        <AxisOrdering value="0"/>
      </Axis>
      <Axis index="1">
        <AxisTag value="wdth"/>
        <AxisNameID value="257"/>  <!-- Width -->
        <AxisOrdering value="1"/>
      </Axis>
      <Axis index="2">
        <AxisTag value="ENLA"/>
        <AxisNameID value="258"/>  <!-- Enlarge -->
        <AxisOrdering value="2"/>
      </Axis>
      <Axis index="3">
        <AxisTag value="ital"/>
        <AxisNameID value="2"/>  <!-- Italic -->
        <AxisOrdering value="3"/>
      </Axis>
    </DesignAxisRecord>
    <!-- AxisValueCount=14 -->
    <AxisValueArray>
      <AxisValue index="0" Format="1">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="306"/>  <!-- Light -->
        <Value value="300.0"/>
      </AxisValue>
      <AxisValue index="1" Format="1">
        <AxisIndex value="0"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="303"/>  <!-- Regular -->
        <Value value="400.0"/>
      </AxisValue>
      <AxisValue index="2" Format="3">
        <AxisIndex value="0"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="303"/>  <!-- Regular -->
        <Value value="400.0"/>
        <LinkedValue value="700.0"/>
      </AxisValue>
      <AxisValue index="3" Format="1">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="305"/>  <!-- Medium -->
        <Value value="500.0"/>
      </AxisValue>
      <AxisValue index="4" Format="1">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="307"/>  <!-- SmBold -->
        <Value value="600.0"/>
      </AxisValue>
      <AxisValue index="5" Format="1">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="304"/>  <!-- Bold -->
        <Value value="700.0"/>
      </AxisValue>
      <AxisValue index="6" Format="1">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="310"/>  <!-- Cond -->
        <Value value="75.0"/>
      </AxisValue>
      <AxisValue index="7" Format="1">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="312"/>  <!-- SmCond -->
        <Value value="88.0"/>
      </AxisValue>
      <AxisValue index="8" Format="1">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="309"/>  <!-- Normal -->
        <Value value="100.0"/>
      </AxisValue>
      <AxisValue index="9" Format="1">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="311"/>  <!-- SmExp -->
        <Value value="113.0"/>
      </AxisValue>
      <AxisValue index="10" Format="1">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="308"/>  <!-- Exp -->
        <Value value="125.0"/>
      </AxisValue>
      <AxisValue index="11" Format="1">
        <AxisIndex value="2"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="303"/>  <!-- Regular -->
        <Value value="0.0"/>
      </AxisValue>
      <AxisValue index="12" Format="1">
        <AxisIndex value="2"/>
        <Flags value="0"/>
        <ValueNameID value="313"/>  <!-- Enlarged -->
        <Value value="100.0"/>
      </AxisValue>
      <AxisValue index="13" Format="1">
        <AxisIndex value="3"/>
        <Flags value="0"/>
        <ValueNameID value="2"/>  <!-- Italic -->
        <Value value="1.0"/>
      </AxisValue>
    </AxisValueArray>
    <ElidedFallbackNameID value="303"/>  <!-- Regular -->
  </STAT>

And then by my mkstat.py script (since fontmake creates a very minimal STAT table; this still contains Format 2 axis values, but I'll probably put back Format 1, since it seems to make no difference):

<STAT>
    <Version value="0x00010001"/>
    <DesignAxisRecordSize value="8"/>
    <!-- DesignAxisCount=4 -->
    <DesignAxisRecord>
      <Axis index="0">
        <AxisTag value="wght"/>
        <AxisNameID value="706"/>  <!-- Weight -->
        <AxisOrdering value="0"/>
      </Axis>
      <Axis index="1">
        <AxisTag value="wdth"/>
        <AxisNameID value="707"/>  <!-- Width -->
        <AxisOrdering value="1"/>
      </Axis>
      <Axis index="2">
        <AxisTag value="ENLA"/>
        <AxisNameID value="708"/>  <!-- Enlarge -->
        <AxisOrdering value="2"/>
      </Axis>
      <Axis index="3">
        <AxisTag value="ital"/>
        <AxisNameID value="710"/>  <!-- Italic -->
        <AxisOrdering value="3"/>
      </Axis>
    </DesignAxisRecord>
    <!-- AxisValueCount=14 -->
    <AxisValueArray>
      <AxisValue index="0" Format="2">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="728"/>  <!-- Light -->
        <NominalValue value="300.0"/>
        <RangeMinValue value="300.0"/>
        <RangeMaxValue value="350.0"/>
      </AxisValue>
      <AxisValue index="1" Format="3">
        <AxisIndex value="0"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="729"/>  <!-- Regular -->
        <Value value="400.0"/>
        <LinkedValue value="700.0"/>
      </AxisValue>
      <AxisValue index="2" Format="2">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="730"/>  <!-- Medium -->
        <NominalValue value="500.0"/>
        <RangeMinValue value="450.0"/>
        <RangeMaxValue value="550.0"/>
      </AxisValue>
      <AxisValue index="3" Format="2">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="731"/>  <!-- SmBold -->
        <NominalValue value="600.0"/>
        <RangeMinValue value="550.0"/>
        <RangeMaxValue value="650.0"/>
      </AxisValue>
      <AxisValue index="4" Format="2">
        <AxisIndex value="0"/>
        <Flags value="0"/>
        <ValueNameID value="732"/>  <!-- Bold -->
        <NominalValue value="700.0"/>
        <RangeMinValue value="650.0"/>
        <RangeMaxValue value="700.0"/>
      </AxisValue>
      <AxisValue index="5" Format="2">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="733"/>  <!-- Cond -->
        <NominalValue value="75.0"/>
        <RangeMinValue value="75.0"/>
        <RangeMaxValue value="81.25"/>
      </AxisValue>
      <AxisValue index="6" Format="2">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="734"/>  <!-- SmCond -->
        <NominalValue value="87.5"/>
        <RangeMinValue value="81.25"/>
        <RangeMaxValue value="93.75"/>
      </AxisValue>
      <AxisValue index="7" Format="2">
        <AxisIndex value="1"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="735"/>  <!-- Normal -->
        <NominalValue value="100.0"/>
        <RangeMinValue value="93.75"/>
        <RangeMaxValue value="106.25"/>
      </AxisValue>
      <AxisValue index="8" Format="2">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="736"/>  <!-- SmExp -->
        <NominalValue value="112.5"/>
        <RangeMinValue value="106.25"/>
        <RangeMaxValue value="118.75"/>
      </AxisValue>
      <AxisValue index="9" Format="2">
        <AxisIndex value="1"/>
        <Flags value="0"/>
        <ValueNameID value="737"/>  <!-- Exp -->
        <NominalValue value="125.0"/>
        <RangeMinValue value="118.75"/>
        <RangeMaxValue value="125.0"/>
      </AxisValue>
      <AxisValue index="10" Format="2">
        <AxisIndex value="2"/>
        <Flags value="2"/>  <!-- ElidableAxisValueName -->
        <ValueNameID value="735"/>  <!-- Normal -->
        <NominalValue value="0.0"/>
        <RangeMinValue value="0.0"/>
        <RangeMaxValue value="23.5"/>
      </AxisValue>
      <AxisValue index="11" Format="2">
        <AxisIndex value="2"/>
        <Flags value="0"/>
        <ValueNameID value="738"/>  <!-- Enlarged -->
        <NominalValue value="47.0"/>
        <RangeMinValue value="23.5"/>
        <RangeMaxValue value="73.5"/>
      </AxisValue>
      <AxisValue index="12" Format="2">
        <AxisIndex value="2"/>
        <Flags value="0"/>
        <ValueNameID value="739"/>  <!-- CapSize -->
        <NominalValue value="100.0"/>
        <RangeMinValue value="73.5"/>
        <RangeMaxValue value="100.0"/>
      </AxisValue>
      <AxisValue index="13" Format="1">
        <AxisIndex value="3"/>
        <Flags value="0"/>
        <ValueNameID value="710"/>  <!-- Italic -->
        <Value value="1.0"/>
      </AxisValue>
    </AxisValueArray>
    <ElidedFallbackNameID value="2"/>  <!-- Italic -->
  </STAT>

psb1558 avatar Aug 06 '23 04:08 psb1558

Also--thanks for the leads on GF fonts that have wrestled with this problem. I'll follow up tomorrow.

psb1558 avatar Aug 06 '23 04:08 psb1558

@kenmcd: Here is a quick survey of the variable fonts you mentioned (where "correctness" means behaving as expected, "stability" means not crashing) in InDesign:

Roboto Flex:
correctness: okay; stability: okay
Has no axis values in STAT or PS names in fvar

Fraunces:
correctness: flips i to r; stability: okay
has PS names, format 2 axis values

Recursive:
correctness: okay; stability: y
Has format 4 (!) for slant axis, otherwise format 1

PlayFair 2:
correctness: okay; stability: y
Has format 1

The diversity here is startling. These fonts are doing things in very different ways and (mostly) succeeding. Only Fraunces exhibits that well-known behavior of flipping the style from italic to roman. None of them crashes InDesign the way Junicode Italic does.

psb1558 avatar Aug 06 '23 16:08 psb1558

Another thing tried: Making sure there were platform 1 entries for fvar PS names and name ID 25. Didn't make any difference. (Glyphs inserts no Platform 1 names.)

I'm removing the platform 1 names now.

I've been over this and over this, and I've followed every lead I've either been given or thought up myself. Now I'm just throwing sh*t at the walls more or less randomly, because I am out of ideas.

I'm knocking off for the time being.

psb1558 avatar Aug 06 '23 17:08 psb1558

I noticed that the Source Serif 4 STAT table had no style linking except for Roman/Italic, and that was two-way linking. Thus the table had only Format 2 and 3 axis values. I decided to try that out, but it had no effect: Italic still crashes InDesign.

psb1558 avatar Aug 07 '23 12:08 psb1558

OK. I'm back. Gonna do some of my own ****-flinging at the wall... Ugh, I forgot... need to update ID to v18. Going to do that first. Sigh.

kenmcd avatar Aug 07 '23 22:08 kenmcd

Good luck to you. I'm pretty fed up.

psb1558 avatar Aug 07 '23 23:08 psb1558

Decided to test first with ID v17.2.1.105 - and at first it appeared to work fine. First, I just install the Roman. Worked fine. Then, installed the Italic, and still appeared to work fine. Looked like this. Windows 11 Tests-2023-08-07-17-25-20

But as soon as I copied that text and pasted it to add more styles - crash.

Not going to update to ID v18.4.0.57 for now.

If it did not work in ID 17, I was going to try versions without an MVAR table. For a long time the GF folks deleted the MVAR table because it caused problems in various applications. Recently they started adding it in again as support has gotten better. Figured deleting the MVAR was a chunk for flinging at the wall. So I tried fonts with no MVAR table. No change - still crashed.

Figured that if the STAT table is the issue, let's see how it works with no STAT tables. I assumed it not work correctly, but just wanted to see if there was no crash. So I installed versions with no STAT table. Italics still work. But the Roman is like it is not there. Looked OK for the moment. But as soon as I copied the text above, and pasted it - crash.

So is it something else? Meaning not the STAT table? No STAT table at all - and ID still crashes.

Gonna look at some other stuff... First take a look at the dueling STAT tables - hmm... should compare the entire fonts. Our answer is in there.

I would like to compare the Glyphs-generated fonts which do not crash, with the fontmake-generated fonts which do crash. Please attach the Glyphs-generated versions for comparison.

kenmcd avatar Aug 08 '23 01:08 kenmcd

Here you go. Italic only—something about the GPOS in the roman disagrees with Glyphs, and it refuses to export.

Those were good experiments. I can say that I looked at the maxp table, and made sure it was okay (I've noticed that it can be a source of instability). If you have thoughts about places to look, I can do part of the looking. Even a small font is a big thing to search through . . .

psb1558 avatar Aug 08 '23 01:08 psb1558

One thing I noticed was that some masters for combining marks didn't have zero widths. Thought that might result in reports of negative widths, possibly causing the crash. Fixed that problem, but unfortunately it didn't help with InDesign.

Another test gone. The good thing is, many of these experiments result in real improvements.

psb1558 avatar Aug 08 '23 03:08 psb1558

Here you go. Italic only—something about the GPOS in the roman disagrees with Glyphs, and it refuses to export.

OK. Got it. Thanks. Let the fun begin! Interesting about the GPOS - I could never get Inter to export from Glyphs in my Ventura VM - and it was an error about the GPOS.

Hmm... I have not tried opening the .glyphs files for Junicode in FontLab - I should try that. And see if I can export. The VF TTF's open with no issues - I should also try exporting those.

kenmcd avatar Aug 08 '23 20:08 kenmcd

Here you go. Italic only—something about the GPOS in the roman disagrees with Glyphs, and it refuses to export.

Was going to do a quick comparison to the other Italic, and it looked terrible in Windows Font Viewer - then I noticed it has "Junicode" not "Junicode VF" as the family names. So it looked odd because it was conflicting with the "Junicode" static versions I have installed here on Win10.

Is this the same Italic font you tested in ID? That worked without crashing? Because that could be because it is actually seen as a different font than the Roman "Junicode VF" family. And that is why it did not conflict with the Roman - it is a different font - and thus did not cause a crash?

Still gonna compare the two versions, but this Glyphs version may not be a "crashless" version.

kenmcd avatar Aug 08 '23 21:08 kenmcd

Long story, but it is the variable font, but family name "Junicode" not "Junicode VF." I'll generate another with "Junicode VF" as the family name and post a link.

psb1558 avatar Aug 08 '23 21:08 psb1558

Here's the link. I'm going to test it now. Super interesting if it crashes.

psb1558 avatar Aug 08 '23 21:08 psb1558

But it doesn't crash. If it doesn't crash when generated by FontLab, or Glyphs, but only fontmake, it would seem that fontmake is making some error on generating the font. I can't even guess what it could be. As the error happens when moving the axis sliders or choosing an instance (on my Mac, anyway: for you it was when you pasted some formatted text), it could be anything affected by an axis change. The big one is gvar, of course, but how do you debug that?

Nothing to do with TrueType hinting--I've also gotten the crashes in builds where I've omitted hinting entirely.

BTW, the font generated by Glyphs has no hints at all. Maybe that's why it looked bad.

psb1558 avatar Aug 08 '23 21:08 psb1558

I poked through the fontmake open issues to see if there were any known issues related to Adobe, and did find one: https://github.com/googlefonts/fontmake/issues/845

No idea if this is related. But apparently fontmake optimizes the gvar table by default and Adobe applications have difficulty dealing with that, so it might be worth turning it off regardless.

marrus-sh avatar Aug 08 '23 21:08 marrus-sh

Thank you, Kibigo!! I'll have a look at that this evening.

(Wonder what turning off optimization will do to the file size.)

psb1558 avatar Aug 08 '23 22:08 psb1558

Here's the link. I'm going to test it now. Super interesting if it crashes.

Thanks got it.

But, apparently my Windows Font Viewer issue was not a "Junicode" name conflict with the installed static fonts as I had guessed - same issue with this Glyphs-generated "Junicode VF" Italic. The left tab is the fontmake version. The right tab is the Glyphs version. That is the same instance - Junicode VF Exp Italic Some of the other instances also have odd spacing issues - e.g. condensed is spaced very wide. Not sure what is going on here. Opened the font in FontCreator to preview the instances - and they look fine. Could just be a Windows thing. I will see how it goes in ID.

2023-08-08_15-39-02

kenmcd avatar Aug 08 '23 22:08 kenmcd