Open PhantomThief opened 8 years ago
Unfortunately patching it locally doesn't work with either the powerline font patcher nor with the one provided by the NerdFonts repository - the former doesn't add them properly, the latter adds much to small glyphs.
I'd be totally happy if any patcher could successfully add the glyphs to the SF Mono fonts, so people could patch their local versions at least.
I highly doubt creating a patchset for a proprietary font would be illegal. Redistributing the font would be illegal, but that isn't what we're talking about here.
I would like this as well.
@abjugard Licensing prevents modifying the fonts too as far as I know. That will be illegal
@PatTheMav I tried patching and am getting weird line-height display:
Any ideas on how to fix this?
@jdsimcoe I don't, unfortunately. I tried tinkering with some settings in the python script but I never got the patcher to get it right. I either had your issues or the glyphs themselves were much too small.
It seems as if Apple is doing some weird stuff with their glyphs and glyph sizes in their SF fonts that prohibits font forge from scaling the new glyphs correctly; then again I'm not a font expert, so..
@PatTheMav Got it 👍 Thanks for the color. It's a weird deal for sure. I found that the Nerd Fonts script got me closer but still not entirely there. It's a shame. SF Mono is a beautiful font.
@jdsimcoe Absolutely, I use it as my default monospace font everywhere (it loses some lustre in non-macOS systems, especially windows - it seems to be fine-tuned for macOS' font rendering).
As I've switched to a very minimal prompt a while ago, I've only had to come up with alternatives for VIm, so I changed my powerline to use normal unicode glyphs instead.. ¯_(ツ)_/¯
That's cool @PatTheMav. I'd be curious to see code snippets of how you modified the powerline stuff.
@PatTheMav yeah, how do you change the powerline to "use normal unicode glyphs"? Can I do configure it with MacVim?
@xiaohk You need to alter top theme: create ~/.config/powerline/config.json
with {"common":{"default_top_theme":"unicode"}}
. I personally use this variant with Vim only: {"ext":{"vim":{"top_theme":"unicode"}}}
, shell and tmux are better with powerline symbols. There are more top themes: http://powerline.readthedocs.io/en/master/configuration/reference.html#themes.
@xiaohk I'm not actually using Powerline, but Airline instead - Airline allows you to set the glyphs inside your .vimrc (also it's not depending on external interpreters).
@ZyX-I Thank you so much, it works perfectly! 👍🏼
@xiaohk Can you send instructions for exactly what you did.
@jdsimcoe Sure. I just did what ZyX-I says above. Create a config.json
file in the powerline configure directory ~/.config/powerline/
(if you don't have it, just create one). Then add {"ext":{"vim":{"top_theme":"unicode"}}}
into config.json
. Set the font to SF Mono
in $MYVIMRC
(set guifont=SF\ Mono:h11
). Relaunch your vim, and it should display the powerline properly.
@xiaohk @ZyX-I can this sort of thing be done for Terminal.app as well so SF Mono works there too?
I use Airline... @PatTheMav do you know how to get that config setup?
Here's my current config (the Powerline glyphs don't appear of course):
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_powerline_fonts = 0
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.whitespace = 'Ξ'
if g:airline_powerline_fonts == 1
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
else
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = '⎋'
let g:airline_symbols.readonly = '✖︎'
let g:airline_symbols.linenr = ''
end
Thanks for sharing!
@PatTheMav I know it's been a while but you might have more success withe the latest version of the Nerd Fonts patcher script
For anyone interested, this SF Mono looks/works pretty ok for me: https://github.com/artofrawr/powerline-fonts/tree/master/fonts/SFMono (it's only Regular though—I'd rather use a Light version)
It's nice to have one, but it's kind of painful to see the blatant disregard for the binding license agreement SF Mono comes with…
FWIW, I've patched SF Mono using the Nerdfont patcher and also added Ligatures with https://github.com/ToxicFrog/Ligaturizer to it. The font works and all glyphs are correctly sized when updated versions of both patchers are used.
For some time now macOS refuses to make the patched SF Mono variations available for font selection in my apps, alas I haven't found the reason yet so I can't say if it's connected in any way.
@PatTheMav do you have a version for download somewhere?
@jdsimcoe As @irrg correctly mentioned before, redistribution is prohibited by the font's license and I personally like to honor license agreements.
(We can't get all fussy about corporations violating e.g. GPL licenses but show wanton disregard for other licenses for that matter).
Cool @PatTheMav I will re-try the scripts then.
@PatTheMav what settings did you use when you did the Nerdfont patcher?
@jdsimcoe I don't think I did anything fancy - selected to have the Powerline glyphs added only and let the patcher do its thing.
I don't remember which commit fixed the issues I had with regards to sizing, but it just "worked" - followed this guide: https://github.com/ryanoasis/nerd-fonts#font-patcher
Cool @PatTheMav --- that worked!
@PatTheMav Thanks a lot! It works :)
The instructions from @PatTheMav indeed worked.
Original SFMono fonts are in /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/
cd
into that directory./font-patcher -q --powerline /path/to/the/SFMono-Regular.otf
~/Library/Fonts/SFMono-Regular.otf
I suggest to patch the "Bold" version too if you want support for bold text in the Terminal.
Protip, use the SF Mono OTFs that come with Xcode, not Terminal. They are in /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework/Versions/A/Resources/Fonts/
.
It's a newer version of the font: "13.1d0e10; 2017-08-09", compared to the original it has a few tweaked glyphs and a couple dozen added glyphs.
The Xcode OTFs are now located at /Applications/Xcode.app/Contents/SharedFrameworks/DVTUserInterfaceKit.framework/Versions/A/Resources/Fonts/
.
Patch SF Mono Font
which is available in XCode 8 beta 6