-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect rendering of triple-wide code ligatures in NetBeans on Windows #369
Comments
Huh, that is a strange effect. 🤔 I’ve tried to copy the feature code for the When you have time, could you perhaps try out the fonts at https://github.com/arrowtype/recursive/tree/3908d42b866d7c56c6de17612775fe8d0501e171/fonts/rec_mono-for-code, and let me know whether the |
Thanks for checking on that! Thanks also for the clear screenshots. I realized that the issue was in many of the ligatures, but wanted to try fixing just one to start, as a test of where the problem might be coming from. I'll have to work on other issues before checking further into this one, but will try to get to it soonish! |
I'm also seeing exactly the same issue in IntelliJ on Windows with the code fonts (both linear and duotone). Notably I did not see this in Fira Code (ie with the |
What's really bad is that the |
Sorry, I wish the fix were more obvious. For now, I suggest either configuring a version of Rec Mono for Code that doesn't have code ligatures, or using another font. You can configure a custom build with: https://github.com/arrowtype/recursive-code-config I will try to fix this, but it will probably take a few weeks to get to it. |
Not sure if this help to solve this issue. In JetBrain Mono, at the moment to create NO Ligatures versions, they are removing the properties for the ligatures to the font with Ligatures. Not sure if these properties exist in Recursive Code You can check the complete code in JetBrains Mono Script |
Checking in FontDrop both font, I cann see these ddiferences JetBrains Mono has kern attribute In Scripts section, they have DFLT, cyrl & latn, and Recursive only has DFLT Hope this information will be helpful :) |
Thanks, @javlaks! Hmm, that is interesting to see how JetBrains has approached their "No Ligature" font and that may obliquely provide clues as to how their normal ligatured font works. But, that is probably more as a way to keep the NL version smaller for the web than directly making the ligature version work in Netbeans. I’ve asked whether the kern is intentional – it’s barely there, so it makes functionally no difference, unless is makes all the difference. Assuming that isn’t the relevant difference, the main approach here will be to use fdiff to compare the font internals, and look specifically at various metadata that could be making this difference, especially in the Things that interest me most at first look are below (JB Mono is "before" # maxp
- <maxPoints value="400"/>
- <maxContours value="100"/>
- <maxCompositePoints value="123"/>
+ <maxPoints value="332"/>
+ <maxContours value="8"/>
+ <maxCompositePoints value="186"/>
- <maxZones value="2"/>
- <maxTwilightPoints value="400"/>
- <maxStorage value="624"/>
- <maxFunctionDefs value="141"/>
+ <maxZones value="1"/>
+ <maxTwilightPoints value="0"/>
+ <maxStorage value="0"/>
+ <maxFunctionDefs value="0"/>
- <maxStackElements value="746"/>
- <maxSizeOfInstructions value="3605"/>
+ <maxStackElements value="0"/>
+ <maxSizeOfInstructions value="0"/>
- <maxComponentDepth value="2"/>
+ <maxComponentDepth value="3"/>
# OS/2
- <xMax value="680"/>
+ <xMax value="2358"/>
# head
<panose>
- <bFamilyType value="2"/>
- <bSerifStyle value="11"/>
- <bWeight value="5"/>
+ <bFamilyType value="0"/>
+ <bSerifStyle value="0"/>
+ <bWeight value="0"/>
<bProportion value="9"/>
- <bContrast value="2"/>
- <bStrokeVariation value="1"/>
- <bArmStyle value="2"/>
- <bLetterForm value="5"/>
+ <bContrast value="0"/>
+ <bStrokeVariation value="0"/>
+ <bArmStyle value="0"/>
+ <bLetterForm value="0"/>
<bMidline value="0"/>
- <bXHeight value="4"/>
+ <bXHeight value="0"/>
</panose>
full diff of
|
For some reason, with the latest IntelliJ and latest Recursive, the issue is fixed for Duotone only. It still happens for Linear, Casual, and SemiCasual. |
Ahhh looking at these fonts in a code editor showed me something which I bet is responsible for this issue. Rec Mono’s ligatures are made monospace by overflowing to the right of their space, and adding empty spaces. Fira Code & JB Mono do the reverse, putting blank spaces & overflow to the left of glyphs. My guess is, maybe NetBeans renders glyphs in a way that constrains overflow to the right to 150% of width, but allows more overflow to the left due to fonts like Fira Code. Or, maybe it’s to do with the way glyphs overlapping – glyphs that come after others will always overlap them. I’ll figure out how to reverse my approach, then try to test it out / ask whether it works for people. |
Oh, hmm. No, it isn’t quite as simple as I had expected. The - <mtx name="equal_equal_equal.liga" width="600" lsb="-1120"/> <!-- JB Mono -->
+ <mtx name="equal_equal_equal.code" width="600" lsb="-1107"/> <!-- Rec Mono --> Fira Code is similar, though it has a UPM of 2000, so values are just doubled. - <mtx name="equal_equal_equal.liga" width="1200" lsb="-2189"/> # Fira Code But, there must be something which causes Glyphs to show the JB Mono TTF & the Rec Mono TTF differently, and maybe this is related to the layout issues in NetBeans. I’ll keep investigating. |
Okay, HERE it is (maybe). In the # JB Mono
- <TTGlyph name="equal_equal_equal.liga" xMin="-1120" yMin="110" xMax="520" yMax="550">
- <contour>
- <pt x="520" y="480" on="1"/>
- <pt x="-1120" y="480" on="1"/>
- <pt x="-1120" y="550" on="1"/>
- <pt x="520" y="550" on="1"/>
- </contour>
# Rec Mono
+ <TTGlyph name="equal_equal_equal.code" xMin="93" yMin="78" xMax="1707" yMax="615"> # Rec Mono
+ <contour>
+ <pt x="1707" y="78" on="1"/>
+ <pt x="1707" y="156" on="1"/>
+ <pt x="1707" y="160" on="0"/>
+ <pt x="1704" y="164" on="0"/>
+ <pt x="1700" y="167" on="0"/>
+ <pt x="1696" y="167" on="1"/>
+ <pt x="93" y="167" on="1"/>
+ <pt x="93" y="89" on="1"/>
+ <pt x="93" y="86" on="0"/>
+ <pt x="96" y="81" on="0"/>
+ <pt x="101" y="78" on="0"/>
+ <pt x="104" y="78" on="1"/>
+ </contour> So, I have to find a way to transform not just the |
Okay, things are looking promising! I have updated the arrowtype/recursive-code-config@3f3a14e#diff-9aaa3ec606057e41b8b37ee20a0f1308 After the changes, they seem to work much better for me: New glyph in GlyphsApp, comparison to previous font in NetBeans (Click to expand)The glyphs now overflow to the left when viewed in GlyphsApp: This is how the previous code ligatures look for me in NetBeans, running on a Windows 10 virtual machine: @javlaks could you please try this out on your end and let me know if it seems to fix the problem for you? You could either download the fonts individually from recursive-code-config or download this zip of them: |
Awesome! Thanks for trying that out. Glad we got this sorted! 🎉
I should document this better or maybe come up with a more creative name.
|
Oh, and as for the specific style of |
Thanks for your hard work on this. It looks amazing. 😉 |
Problem description
Your font is amazing, beautiful, however, some ligatures are not being displayed correctly in NetBeans
Expected behavior
Display ligatures correctly as in Visual Studio Code
Screenshots
This is from NetBeans 12.0
This is from Visual Studio Code 1.47.3
To Reproduce
Steps to reproduce the behavior:
Environment
Additional context
Other ligatures fonts as JetBrains Mono or Fira Code, doesn't have this issue. They display correctly
The text was updated successfully, but these errors were encountered: