ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
54.57k stars 3.65k forks source link

Provide single font with custom glyphs only for Fontconfig aliasing #84

Closed mbirth closed 7 years ago

mbirth commented 8 years ago

Please provide an all-in-one font with only the custom glyphs so it can be used with Fontconfig aliasing.

This is much easier than patching all fonts.

ryanoasis commented 8 years ago

Yes you are right in many cases this would be ideal. :+1:

Fontconfig unfortunately I was not aware of when I started on this journey :relaxed: but we should provide something even with a font patcher and providing patched fonts :smile:

be5invis commented 8 years ago

And yes, providing a “custom-only” font file (in ttf) is extremely useful for users to patch their own fonts.

lcorsini commented 7 years ago

Made another try today at getting my fonts working right, and I think that on linux this would be the best approach. Actually patched fonts look blurry and incorrectly sized (correctly sized characters, but insanely small glyphs) on my machine (arch linux currently and on terminator) fallback fontconfig seems to work great, but it's not perfect: Using an already powerline-patched font for example (I use Terminess powerline)

ATM using a non powerline font (original Terminus, I still love that font!) and having devicons and fontawesome fallback somehow works but the situation is not perfect Also some other projects like vim-airline or zsh's powerlevel9k need to be worked out because of different glyphs used so:

A common "glyph-library" that could be used in fallback or for a easier patching could be easier to maintain and also could be shared and supported by other projects

lcorsini commented 7 years ago

Ok, I've found a partial solution, if you use fontconfig fallback with a complete mono font it works. Right now in my .fonts I have the patched Shure Tech Mono and my terminal is configured to use Terminus. If I need a glyph fontconfig takes it from Shure Tech Mono, the only downside is that the glyphs are a little smaller.

To use powerlever9k I made a fork available here: https://github.com/lcorsini/powerlevel9k where I created a new option for POWERLEVEL9K_MODE named nerdfont-fontconfig so in .zshrc you need to put POWERLEVEL9K_MODE='nerdfont-fontconfig' to use the correct glyphs

ryanoasis commented 7 years ago

@lcorsini

but insanely small glyphs

Just curious were you using the fonts from the 0.9.0 branch ? Because a lot of the size issues have been fixed.

Yeah so the main problem with this patching is that with conflicts some glyph set is going to "win" and another has to "lose" and it seemed like a good choice for font awesome to "win" these conflicts and so the font linux and any other that conflict get moved.

A common "glyph-library" that could be used in fallback or for a easier patching could be easier to maintain and also could be shared and supported by other projects

Yeah I agree this would be awesome and I would like that library to be Nerd Fonts :blush: but the project has been mostly focused on patching and not creating a fontconfig. I would love to have a fontconfig available on Nerd Fonts but I just haven't gotten around to it.

To use powerlever9k I made a fork available here: https://github.com/lcorsini/powerlevel9k

lookin' good :+1:

lcorsini commented 7 years ago

Just curious were you using the fonts from the 0.9.0 branch ? Because a lot of the size issues have been fixed.

Yes I'm using the 0.9.0 branch, today I'll try a different fallback font (I choose ShureTechMono), my impression is that fontconfig tries to match the dimension of the current font so maybe the one I'm using is smaller than my current font at 12pt. I'll try different ones and see what fits better EDIT Ok using a different font is better, here is ShureTechMono as fallback: capture_shuretech And here used Roboto capture_roboto which is better

Yeah I agree this would be awesome and I would like that library to be Nerd Fonts :blush: but the project has been mostly focused on patching and not creating a fontconfig. I would love to have a fontconfig available on Nerd Fonts but I just haven't gotten around to it.

Well I think that a consolidated glyph library could help your project AND fontconfig. it's probably easier to patch a font using one source instead of multiple (so one nerdfont.otf instead of devicons+font-linux+fontawesome+pomodoro+octicons) and that file could be used for font fallback whitout much effort, also it could be cleaned up a little (there is some duplicate in your approach) It's probably a bigger effort, but could repay in the longtime.

To use powerlever9k I made a fork available here: https://github.com/lcorsini/powerlevel9k lookin' good :+1:

Thanks, also speaking with vim-airline guys I was able to fix the last problem with vim (see here https://github.com/vim-airline/vim-airline/issues/1320) the correct column number font (or maxlinenr) if someone had the same problem as me

ryanoasis commented 7 years ago

Very much a WIP. I am new to fontconfig.. but just pushing up as I work on it

Edit the WIP: https://github.com/ryanoasis/nerd-fonts/commit/3b5dff7b6bf92e3621ac26fa6e191d1f53976f50

msva commented 7 years ago

@ryanoasis and what do you think about: 1) removing some duplicate glyphs (for example, it is multiple octocat faces, tuxes, win10 flags, ...), including multiple-sized (npm, octocat silhouette, drupal, CC, tablet and smartphone (that ones has microscopic clone-glyphs)). And maybe even give their place to, say, font-linux glyphs, to not move them so far
2) maybe dropping some logo glyphs, that is impossible to read at terminal font sizes (9-11pt). Like that: (it is also microscopic smartphone/tablet glyphs here). 3) look how google guys did their Noto Color Emoji font, so it's glyphs can be rendered as colored even in terminals that don't support svgs (unlike Emoji One Colour font, which bundles SVGs in addition, so it is only firefox, who able to render them). And then add some colored versions in NerdSymbols too :) 4) providing something like all_chars.txt with all the characters that font contain (for testing purposes and ease the way to get their codes (to not scroll entire list in fontforge)).

// For example, I see in kfontview app that "linux-font" glyphs is somewhere "at the end", but I can't get their codes 😢

ryanoasis commented 7 years ago

@msva Thanks

  1. That's a good point. I think it has been brought up before or at least I thought about it. Hmm I would say I am leaning toward not doing that because this is more of a grouping of different iconic fonts than it's own custom build (though there have been some custom additions or one-offs). However perhaps in a next major version we could consider this (e.g. v2.0)
  2. My answer here kind of follows #1 I would prefer to leave them. the tablet phone one comes that way in the original glyph source.. maybe we could do some tweaks to maximize it but this would go beyond what anything we currently do.
  3. Thanks I have seen the font before but haven't gone too far with color fonts (type3) or svg based ones. Yes colors would be really awesome! I agree
  4. I am actually working on improving the test script to do something like this :wink: . Here is a peak: selection_018
FranklinYu commented 7 years ago

Hi everyone. I'm not very familiar with Fontconfig; is there any way to use fallback method on macOS like this?

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.