Skip to content

Inconsistent baseline of Rec Mono fonts between regular and italic/bold in Sublime Text on Windows 10 #418

Description

@jwortmann

Problem description

In Sublime Text 3.2.2, the italic and bold versions of the "Rec Mono" fonts (Recursive_Code folder, Version 1.066) are shifted towards the bottom by a significant amount, in comparison to the regular font version. This happens at all font sizes. The same applies to custom fonts generated via https://github.com/arrowtype/recursive-code-config (Version 1.065). The issue doesn't occur in VS Code or Atom with the same font files. Also, the pregenerated static versions (Recursive_Desktop folder) don't suffer from this problem in Sublime Text, but they seem to have larger discrepancies between opening and closing brackets at certain font sizes than the "Rec Mono" versions (#297).

Screenshots

Example with "Reg Mono Linear":

screenshot

Environment

  • OS: Windows 10 v2004
  • Application: Sublime Text 3.2.2
  • Fonts: Rec Mono fonts v1.066 from Recursive_Code folder and Rec Mono Custom v1.065

Additional context

I'm not sure if this problem is the same or related to #308.

Activity

  1. arrowtype commented on Nov 12, 2020

    @arrowtype
    Owner

    Ouch, that is some painful misalignment! 😅 Thanks for taking the time to write an issue and to include some clear screenshots.

    I will try to take a look at this asap – I will check whether the vertical metrics are the same or not, and whether some of the styles have points that are somehow a lot higher or lower.

    I’ve also run into an issue similar to #297 on another project, and realized that sometimes, opening & closing punctuation just can use one another as components, as text renderers just seem to mess this rotation up for some reason. So, I’ll probably look into (and hopefully fix) both of these issues at the same time.

  2. seritools commented on Nov 26, 2020

    @seritools

    The issue doesn't occur in VS Code or Atom with the same font files.

    I'm not 100% sure if this is the same problem, but it definitely seems to happen in VSCode as well:

    image
    Notice how the lines with comments (= italic/curly) are positioned slightly lower than the others. You can see it jump around whenever it switches to italics.

    It's also very apparent in Windows Terminal if you switch the terminal font from Regular to Bold - major line height difference:
    image
    image

  3. arrowtype commented on Dec 17, 2020

    @arrowtype
    Owner

    Looking into this, so I’ll make some notes.

    Notable diffs between Rec Mono Duotone, Regular & Bold

    It is notable that there aren’t diffs (and shouldn’t be) in the key data entries that are supposed to set vertical metrics for fonts:

        <sTypoAscender value="950"/>
        <sTypoDescender value="-250"/>
        <sTypoLineGap value="0"/>
        <usWinAscent value="1207"/>
        <usWinDescent value="271"/>
    

    However, it seems possible that Windows code environments might be looking at min & max Y coordinates, and setting line heights based in part on that. From the head tables:

    -    <yMin value="-367"/>
    -    <yMax value="1134"/>
    +    <yMin value="-400"/>
    +    <yMax value="1160"/>
    Full diffs for Rg/Bold, tables head, hhea, OS/2 (Click to expand)
    ▶ fdiff --include head,hhea,OS/2 "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf" "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Bold-1.069.ttf"
    --- fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf     2020-12-11T12:09:06.882925-05:00
    +++ fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Bold-1.069.ttf        2020-12-11T12:09:20.501704-05:00
    @@ -5,20 +5,20 @@
         <!-- Most of this table will be recalculated by the compiler -->
         <tableVersion value="1.0"/>
         <fontRevision value="1.069"/>
    -    <checkSumAdjustment value="0xa107dc67"/>
    +    <checkSumAdjustment value="0xabb94723"/>
         <magicNumber value="0x5f0f3cf5"/>
         <flags value="00000000 00000001"/>
         <unitsPerEm value="1000"/>
    -    <created value="Fri Dec 11 17:09:05 2020"/>
    -    <modified value="Fri Dec 11 17:09:06 2020"/>
    -    <xMin value="-1772"/>
    -    <yMin value="-367"/>
    -    <xMax value="704"/>
    -    <yMax value="1134"/>
    -    <macStyle value="00000000 00000000"/>
    +    <created value="Fri Dec 11 17:09:19 2020"/>
    +    <modified value="Fri Dec 11 17:09:20 2020"/>
    +    <xMin value="-1752"/>
    +    <yMin value="-400"/>
    +    <xMax value="690"/>
    +    <yMax value="1160"/>
    +    <macStyle value="00000000 00000001"/>
         <lowestRecPPEM value="6"/>
         <fontDirectionHint value="2"/>
    -    <indexToLocFormat value="0"/>
    +    <indexToLocFormat value="1"/>
         <glyphDataFormat value="0"/>
       </head>
     
    @@ -28,9 +28,9 @@
         <descent value="-250"/>
         <lineGap value="0"/>
         <advanceWidthMax value="600"/>
    -    <minLeftSideBearing value="-1772"/>
    -    <minRightSideBearing value="-336"/>
    -    <xMaxExtent value="704"/>
    +    <minLeftSideBearing value="-1752"/>
    +    <minRightSideBearing value="-345"/>
    +    <xMaxExtent value="690"/>
         <caretSlopeRise value="1"/>
         <caretSlopeRun value="0"/>
         <caretOffset value="0"/>
    @@ -47,7 +47,7 @@
              will be recalculated by the compiler -->
         <version value="4"/>
         <xAvgCharWidth value="599"/>
    -    <usWeightClass value="400"/>
    +    <usWeightClass value="750"/>
         <usWidthClass value="5"/>
         <fsType value="00000000 00001000"/>
         <ySubscriptXSize value="650"/>
    @@ -78,7 +78,7 @@
         <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
         <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
         <achVendID value="ARRW"/>
    -    <fsSelection value="00000000 11000000"/>
    +    <fsSelection value="00000000 00100000"/>
         <usFirstCharIndex value="13"/>
         <usLastCharIndex value="64260"/>
         <sTypoAscender value="950"/>

    Regular vs Italic

    In Rec Mono Duotone, Regular vs Italic, the yMax value is the only potentially-meaningful diff:

    -    <xMax value="704"/>
    -    <yMax value="1134"/>
    -    <macStyle value="00000000 00000000"/>
    +    <xMax value="745"/>
    +    <yMax value="1128"/>
    Full diffs for Rg/Ital, tables head,hhea,OS/2 (Click to expand)
    ▶ fdiff --include head,hhea,OS/2 "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf" "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Bold-1.069.ttf"
    --- fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf     2020-12-11T12:09:06.882925-05:00
    +++ fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Bold-1.069.ttf        2020-12-11T12:09:20.501704-05:00
    @@ -5,20 +5,20 @@
         <!-- Most of this table will be recalculated by the compiler -->
         <tableVersion value="1.0"/>
         <fontRevision value="1.069"/>
    -    <checkSumAdjustment value="0xa107dc67"/>
    +    <checkSumAdjustment value="0xabb94723"/>
         <magicNumber value="0x5f0f3cf5"/>
         <flags value="00000000 00000001"/>
         <unitsPerEm value="1000"/>
    -    <created value="Fri Dec 11 17:09:05 2020"/>
    -    <modified value="Fri Dec 11 17:09:06 2020"/>
    -    <xMin value="-1772"/>
    -    <yMin value="-367"/>
    -    <xMax value="704"/>
    -    <yMax value="1134"/>
    -    <macStyle value="00000000 00000000"/>
    +    <created value="Fri Dec 11 17:09:19 2020"/>
    +    <modified value="Fri Dec 11 17:09:20 2020"/>
    +    <xMin value="-1752"/>
    +    <yMin value="-400"/>
    +    <xMax value="690"/>
    +    <yMax value="1160"/>
    +    <macStyle value="00000000 00000001"/>
         <lowestRecPPEM value="6"/>
         <fontDirectionHint value="2"/>
    -    <indexToLocFormat value="0"/>
    +    <indexToLocFormat value="1"/>
         <glyphDataFormat value="0"/>
       </head>
     
    @@ -28,9 +28,9 @@
         <descent value="-250"/>
         <lineGap value="0"/>
         <advanceWidthMax value="600"/>
    -    <minLeftSideBearing value="-1772"/>
    -    <minRightSideBearing value="-336"/>
    -    <xMaxExtent value="704"/>
    +    <minLeftSideBearing value="-1752"/>
    +    <minRightSideBearing value="-345"/>
    +    <xMaxExtent value="690"/>
         <caretSlopeRise value="1"/>
         <caretSlopeRun value="0"/>
         <caretOffset value="0"/>
    @@ -47,7 +47,7 @@
              will be recalculated by the compiler -->
         <version value="4"/>
         <xAvgCharWidth value="599"/>
    -    <usWeightClass value="400"/>
    +    <usWeightClass value="750"/>
         <usWidthClass value="5"/>
         <fsType value="00000000 00001000"/>
         <ySubscriptXSize value="650"/>
    @@ -78,7 +78,7 @@
         <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
         <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
         <achVendID value="ARRW"/>
    -    <fsSelection value="00000000 11000000"/>
    +    <fsSelection value="00000000 00100000"/>
         <usFirstCharIndex value="13"/>
         <usLastCharIndex value="64260"/>
         <sTypoAscender value="950"/>
    (venv) 
    ~/type-repos/recursive  add-ufo2ft-comp-filters ✗                                      13h34m ✖ ⚑  
    ▶ fdiff --include head,hhea,OS/2 "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf" "fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Italic-1.069.ttf"
    --- fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Regular-1.069.ttf     2020-12-11T12:09:06.882925-05:00
    +++ fonts/ArrowType-Recursive-1.069/Recursive_Code/Duotone/RecMonoDuotone-Italic-1.069.ttf      2020-12-11T12:09:14.084596-05:00
    @@ -5,20 +5,20 @@
         <!-- Most of this table will be recalculated by the compiler -->
         <tableVersion value="1.0"/>
         <fontRevision value="1.069"/>
    -    <checkSumAdjustment value="0xa107dc67"/>
    +    <checkSumAdjustment value="0x2041ccf7"/>
         <magicNumber value="0x5f0f3cf5"/>
         <flags value="00000000 00000001"/>
         <unitsPerEm value="1000"/>
    -    <created value="Fri Dec 11 17:09:05 2020"/>
    -    <modified value="Fri Dec 11 17:09:06 2020"/>
    -    <xMin value="-1772"/>
    +    <created value="Fri Dec 11 17:09:12 2020"/>
    +    <modified value="Fri Dec 11 17:09:13 2020"/>
    +    <xMin value="-1785"/>
         <yMin value="-367"/>
    -    <xMax value="704"/>
    -    <yMax value="1134"/>
    -    <macStyle value="00000000 00000000"/>
    +    <xMax value="745"/>
    +    <yMax value="1128"/>
    +    <macStyle value="00000000 00000010"/>
         <lowestRecPPEM value="6"/>
         <fontDirectionHint value="2"/>
    -    <indexToLocFormat value="0"/>
    +    <indexToLocFormat value="1"/>
         <glyphDataFormat value="0"/>
       </head>
     
    @@ -28,11 +28,11 @@
         <descent value="-250"/>
         <lineGap value="0"/>
         <advanceWidthMax value="600"/>
    -    <minLeftSideBearing value="-1772"/>
    -    <minRightSideBearing value="-336"/>
    -    <xMaxExtent value="704"/>
    -    <caretSlopeRise value="1"/>
    -    <caretSlopeRun value="0"/>
    +    <minLeftSideBearing value="-1785"/>
    +    <minRightSideBearing value="-414"/>
    +    <xMaxExtent value="745"/>
    +    <caretSlopeRise value="667"/>
    +    <caretSlopeRun value="167"/>
         <caretOffset value="0"/>
         <reserved0 value="0"/>
         <reserved1 value="0"/>
    @@ -52,11 +52,11 @@
         <fsType value="00000000 00001000"/>
         <ySubscriptXSize value="650"/>
         <ySubscriptYSize value="600"/>
    -    <ySubscriptXOffset value="0"/>
    +    <ySubscriptXOffset value="-13"/>
         <ySubscriptYOffset value="75"/>
         <ySuperscriptXSize value="650"/>
         <ySuperscriptYSize value="600"/>
    -    <ySuperscriptXOffset value="0"/>
    +    <ySuperscriptXOffset value="59"/>
         <ySuperscriptYOffset value="350"/>
         <yStrikeoutSize value="45"/>
         <yStrikeoutPosition value="282"/>
    @@ -69,7 +69,7 @@
           <bContrast value="0"/>
           <bStrokeVariation value="0"/>
           <bArmStyle value="0"/>
    -      <bLetterForm value="0"/>
    +      <bLetterForm value="11"/>
           <bMidline value="0"/>
           <bXHeight value="0"/>
         </panose>
    @@ -78,7 +78,7 @@
         <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
         <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
         <achVendID value="ARRW"/>
    -    <fsSelection value="00000000 11000000"/>
    +    <fsSelection value="00000000 00000001"/>
         <usFirstCharIndex value="13"/>
         <usLastCharIndex value="64260"/>
         <sTypoAscender value="950"/>

    Next steps

    It’s of course possible that this could be caused by something else, but the first thing I’ll test is setting consistent yMin & yMax values.

    • find yMin & yMax of all styles (possibly in the sources, because the VF head table has values specific to the default source, Sans Linear Light)
    • set yMin and yMax values to be the same across all instances
    • test this out in Sublime on Windows 10
  4. arrowtype commented on Jan 4, 2021

    @arrowtype
    Owner

    (Taking some notes here for myself.)

    After checking all sources in the font prep folder, I’ve found that

    • The family minY is -455
    • The family maxY is 1208

    With the previous version of Rec Mono Duotone (1.070), I have reproduced the issues on Windows 10:

    image

    Unfortunately, even after setting the min & max Y values to be the same across all fonts, the problem persists:

    image

    This test was done in https://github.com/arrowtype/recursive-code-config/tree/c3535664790abb8866a6c1acdad122749223f42c.

    I’m realizing that the original comment in this issue helpfully shows that the normal (non "Code") fonts do have proper alignment, so I should really be diffing the Code fonts against the normal fonts. To be continued!

  5. arrowtype commented on Jan 4, 2021

    @arrowtype
    Owner

    RecursiveMonoLnrSt-Italic.ttf (normal) vs RecMonoLinear-Italic-1.070.ttf (Code).

    Rec Mono excludes the BASE table, while it is included in the normal font. This might be the cause of the issue, but I need to research further.

    The fsSelection is also different – I should run FontBakery on the Rec Mono fonts to check again whether they are set incorrectly here.

    -    <fsSelection value="00000001 10000001"/>
    +    <fsSelection value="00000000 00000001"/>
    
  6. arrowtype commented on Feb 13, 2021

    @arrowtype
    Owner

    It tentatively seems that this issue might have the same solution as #308. Testing the variable font, this look promising:

    image

    I’ll still have to follow up with tests of the Code fonts, however, to confirm & hopefully close this issue.

  7. arrowtype commented on Feb 14, 2021

    @arrowtype
    Owner

    Shoot. Unfortunately, solving issue 308 hasn’t changed this, yet.

    I’ll keep this in mind and try to solve it, but I probably won’t crack it immediately.

    I know this isn’t what anyone probably wants to hear, but for now, the workarounds I suggest are:

    1. Use the standard Recursive fonts (not the "Code" fonts). This won’t allow the “Duotone” theming, but it will render (mostly) better. When these are installed, you can activate them with either Recursive Mn Lnr St (Linear) or Recursive Mn Csl St (Casual). If you want to enable stylistic sets or code ligatures, you can do so with a preference in the format "font_options": ["ss01", "ss05", "dlig"]. (Caveat: some code ligatures, like <=, aren’t working in Sublime, despite working elsewhere.)
    2. Use VS Code. Things seem to be working well here. (Sorry!)
    3. Use another font. (Sorry!)

    image

    image

  8. changed the title [-]Inconsistent baseline of Rec Mono fonts between regular and italic/bold in Sublime Text[/-] [+]Inconsistent baseline of Rec Mono fonts between regular and italic/bold in Sublime Text on Windows 10[/+] on Feb 14, 2021
  9. arrowtype commented on Feb 19, 2021

    @arrowtype
    Owner

    Okay, I think I may have cracked this (!).

    image

    I set the fsSelection bit 7 (Use Typo Metrics).

    @jwortmann (or someone else) would you mind testing the fonts at the latest Recursive Code commit?

    For convenience, here is a zip of them:
    rec_mono_code-patch-2020_02_19.zip

    (Just make sure to Install over the previous versions)

    image

  10. jwortmann commented on Feb 19, 2021

    @jwortmann
    Author

    I just tried the new font files from the zip and can confirm that everything works fine for me now.
    Thanks a lot for fixing this problem and for this great typeface in general!

    I think this issue can be closed now.

  11. arrowtype commented on Feb 19, 2021

    @arrowtype
    Owner

    YESSSS thank you for confirming that! I'll add these to the release as a "hotfix" now.

  12. arrowtype commented on Feb 19, 2021

    @arrowtype
    Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions