Skip to content

MacVim + Catalina Font issues #949

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

Closed
9mm opened this issue Oct 8, 2019 · 20 comments
Closed

MacVim + Catalina Font issues #949

9mm opened this issue Oct 8, 2019 · 20 comments

Comments

@9mm
Copy link

9mm commented Oct 8, 2019

Describe the bug

Before installing Catalina, MacVim font looked fantastic when paired with Anonymous Pro (https://www.marksimonson.com/fonts/view/anonymous-pro).

Now however, everything looks very weird, like it's spaced out with extra pixels between each letter.

Here is before installing (I believe this was Mojave when I took this screenshot):

and here is after

image

Environment (please complete the following information):

  • Vim version [e.g. 8.1.1234] (Or paste the result of vim --version.) latest mvim from homebrew --HEAD
  • OS: [e.g. Ubuntu 18.04, Windows 10 1809, macOS 10.14] 10.15
  • Terminal: [e.g. GNOME Terminal, mintty, iTerm2, tmux, GNU screen] (Use GUI if you use the GUI.) iterm 3
@9mm
Copy link
Author

9mm commented Oct 8, 2019

I actually booted up an old computer using Mojave just so I could make sure I wasn't crazy. Here's the exact same MacVim configuration using the same fonts. You can see from NerdTree listing that it's very different

Screen Shot 2019-10-08 at 1 04 44 PM

Screen Shot 2019-10-08 at 1 04 57 PM

@9mm
Copy link
Author

9mm commented Oct 8, 2019

I actually loaded it into Photoshop... the pixels actually line up perfectly but they are just a tiny bit less transparent. I assume this isn't a MacVim issue, but some way OSX changed how they render fonts. I really wish I knew what it was because I absolutely hate it. All the fonts look naked and weak

@9mm
Copy link
Author

9mm commented Oct 8, 2019

Ah! The line-height most definitely DID change though, thats what causes the most disturbing results.. there's so much space between the lines.

I could live with the seemingly "weaker" letters, but the space between the lines is atrocious. I'm not sure how I would go about putting it back though.

@eirnym
Copy link
Contributor

eirnym commented Oct 8, 2019

on different versions of macOS and in different apps I've used different fonts. This was also caused with different font versions.

Currently I use Fira Code Light and previously I've used Anonymous Pro and Roboto and few others.

@9mm
Copy link
Author

9mm commented Oct 8, 2019

I checked the version of Anonymous Pro but it seems to be the same for the last many years. It definitely changed though when upgrading to Catalina, and now I can't restore the old lineheight. :/

@eirnym
Copy link
Contributor

eirnym commented Oct 9, 2019

Could you test the font in different applications to check if they process it differently?

Lastly MacVim started to honor more font properties on initialization, so it could affect as well.

@9mm
Copy link
Author

9mm commented Oct 10, 2019

Oh wow... I just re-downloaded release 157 from the releases page and it was fixed (it was probably because i installed with --HEAD because of the other issue with homebrew hash not matching).

So the new changes are definitely crazy on my end. Is that something that is 100% going to be merged into 158 and onwards? If so I will basically stop updating because the font is sadly unusable because it is hideous haha

@9mm
Copy link
Author

9mm commented Oct 10, 2019

or is there any way to use a new version but keep the old font settings?

@eirnym
Copy link
Contributor

eirnym commented Oct 10, 2019

Could you explain the difference? Screenshot difference will be the best.

@9mm
Copy link
Author

9mm commented Oct 10, 2019

You can see it very clearly in the sidebar, it adds so much whitespace between the lines

the second thing it does is very subtly makes the text 'crisper' but it also looks weaker. that is more subtle though and maybe isnt super clear in a photo, i used photoshop to check though. that is less of a big deal as the line height which totally kills my favorite font

BEFORE (GOOD):

Screen Shot 2019-10-10 at 4 19 39 PM

AFTER (BAD):

bad

@skyksandr
Copy link

As a workaround I set linespace=-1

@eirnym
Copy link
Contributor

eirnym commented Oct 14, 2019

@9mm Thank you for sharing screenshots.

You use modified Anonymous Pro font, and I don't except the external modification will preserve same quality as Anonymous Pro itself.

I installed the font and tested it:

  • Powerline/AirLine symbols are not provided by this font
  • Linespace between size 12 (and below) and 13 (and above) is different.
  • Japanese symbols are not shown with sizes below 12 (inclusive).
  • No ligatures (I like them)

I'd select 13 which on my screen looks the best if I'd use this font.

Anonymous Pro (original), size 12:
Zrzut ekranu 2019-10-14 o 11 56 05

Anonymous Pro (original), size 13:
Zrzut ekranu 2019-10-14 o 11 56 55

Fira Code Light (original), size 12:
Zrzut ekranu 2019-10-14 o 11 59 03

@9mm
Copy link
Author

9mm commented Oct 14, 2019

@eirnym the font itself shouldn't have changed with the added powerline symbols. I tested here with both fonts, and you can use photoshop to verify they're identical, so the difference came from macvim/vim (installing old macvim with same powerline font works how it should)

both fonts identical:
Screen Shot 2019-10-14 at 8 03 41 AM
Screen Shot 2019-10-14 at 8 04 02 AM

here is how it used to be for reference:

image

@skyksandr thanks... i messed around with linespace and nothing actually changed before, and I just tried again this morning and it works! I probably mixed up set/let. This fixed it, thanks! Crazily enough, I had to do set linespace=-3 to get it back exactly how it was

@eirnym
Copy link
Contributor

eirnym commented Oct 14, 2019

@9mm I've tried a few fonts from that repo (if we speak about the same mod repo), but fonts there in general seems to be very outdated for a few releases at least and some parameters were altered (like linespacing for some fonts). So yes, general symbols might not be changed, but other parameters and symbols might not be the same.

Thus I've found a font with these symbols and which support a few languages I type with support of airline symbols (you see my last screenshot above).

@9mm
Copy link
Author

9mm commented Oct 14, 2019

Sorry, maybe were not talking about the same thing. I was basically wondering what in macvim/vim changed for my fonts to be so different (it's not related to the 'with powerline' modification of the font because i've used the same font for 5 years or so). You may be correct that it modifies/ruins the font, but I haven't noticed any changes besides what is caused by the --HEAD version of macvim.

With all that said though, the set linespace=-3 thing fixed the issue so I suppose I'm good as long as that continues to work :D I still out of curiosity would be curious to know what changed though, because I see the same linespace problem with the normal Anonymous Pro directly from the source: https://www.marksimonson.com/fonts/view/anonymous-pro

@eirnym
Copy link
Contributor

eirnym commented Oct 15, 2019

I use the same build from GitHub (as I used on 10.14) and in my case nothing has been changed. For my font build from the HEAD changes nothing as well.

Zrzut ekranu 2019-10-15 o 10 34 48

Underneath MacVim uses NSTextView which may changed font processing somehow (e.g. use some font parameters not used before or use them differently).

@eirnym
Copy link
Contributor

eirnym commented Oct 15, 2019

Your font looks better with HEAD (linespacing is still 0) and I hope these changes will be released as soon as possible (see #905 for details)

Zrzut ekranu 2019-10-15 o 10 28 28

Zrzut ekranu 2019-10-15 o 10 28 40

Zrzut ekranu 2019-10-15 o 10 28 56

@ychin
Copy link
Member

ychin commented Oct 17, 2019

The new release should have fixed it. Let me know if it doesn't work and I'll see if there are other reasons why it doesn't look right @9mm.

I think this was basically #928.

@9mm
Copy link
Author

9mm commented Oct 17, 2019

Thanks it fixed it, and now I removed linespace=-3 👍

@9mm 9mm closed this as completed Oct 17, 2019
@eirnym
Copy link
Contributor

eirnym commented Oct 17, 2019

Good to hear that!

ychin added a commit to ychin/macvim that referenced this issue Dec 26, 2020
Recent change to stateful renderer (macvim-dev#858) has inadvertantly changed how
MacVim handles line spacing. Previously, MacVim intentionally ignores
the line spacing of a font and creates a new dummy font that essentially
has line spacing of 1, but the new code uses the font as is. This means
font with non-standard line spacing (e.g. Input Mono) will look
different. This is technically the correct way to handle fonts but is
different from how MacVim has worked for years.

Also, see last time this regression (where MacVim didn't discard line
spacing) happened in macvim-dev#928 / macvim-dev#949 which was fixed in macvim-dev#957. Also see macvim-dev#977
where the bug was filed the other way requesting for using the font's
line spacing instead of discarding it.

This commit re-introduces the behavior to discard line spacing, but only
provides it as an option (can be set in the preference pane), while
defaulting to using the line spacing as that seems more correct.

Note that from a casual survey of other terminals and editors, this
behavior is quite inconsistent. Xcode does use the font's line spacing,
and was partially the motivation of switching to that as a default.

Close macvim-dev#1152.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants