Skip to content
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

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

Closed
mbirth opened this issue May 14, 2016 · 11 comments
Closed

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

mbirth opened this issue May 14, 2016 · 11 comments

Comments

@mbirth
Copy link

mbirth commented May 14, 2016

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
Copy link
Owner

Yes you are right in many cases this would be ideal. 👍

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

@be5invis
Copy link
Collaborator

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

@ryanoasis ryanoasis added this to the v0.9.0 milestone Jun 2, 2016
@ryanoasis ryanoasis modified the milestone: v0.9.0 Aug 26, 2016
@lcorsini
Copy link

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)

  • in vim-devicons some glyphs are misplaced because patching moves them to different places.
    capture2
  • the same happens with font-linux that clashes with FontAwesome in it's original form so font-linux glyphs aren't available
    capture

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
Copy link

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
Copy link
Owner

ryanoasis commented Nov 16, 2016

@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 😊 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 👍

@lcorsini
Copy link

lcorsini commented Nov 17, 2016

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 😊 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 👍

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

@ryanoasis
Copy link
Owner

ryanoasis commented Nov 30, 2016

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

Edit the WIP: 3b5dff7

@msva
Copy link

msva commented Mar 22, 2017

@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
Copy link
Owner

@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 😉 . Here is a peak:
    selection_018

@FranklinYu
Copy link

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

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants