Comments (47)
Going to reopen because:
- Obviously still an issue
- The commit to close was an "Attempt to fix" and no verification was done to ensure
- This issue was fallen off of the radar.. I last commented almost a year ago. Apologies to @Undistraction and @Mike3run
Thanks @zxaos for getting this back to visibility for me.
I don't know if this will be apart of the next release or not. Goal of 1 per month has been severely lagging. Need to revisit methodology perhaps
from nerd-fonts.
I know this has fallen off the radar. Trying to come up with better system to keep up with the issues
from nerd-fonts.
@ryanoasis I think this is an issue with FontForge not giving scripts access to font style names (fontforge/fontforge#1061) and relying on autogessing style. Hence you get very strange styles in your fonts such as NerdFontComplete
instead of Regular
.
The resulting PS Font Name ($fontname
set to fontname + Suffix in your patcher) is identical for all different styles (e.g. SauceCodeProNerdFontComplete
for both Regular and Medium instead of SauceCodeProNerdComplete-Regular
and SauceCodeProNerdComplete-Medium
) and Mac throws this error.
After I've used your script to generate the required fonts the only perfect solution to the naming mess I've found was to use FontLab
- set a proper Family name (e.g. Sauce Code ProNerdC for the 'Complete' version) β this would be the same for all the generated fonts with a given variation of extra glyph sets
- Auto-generate everything with 3 buttons (
Build Style Name
,Build Names
, andBuild OpenType Names
) to get clean names - Propagate these changes by clicking 'Import Names' in
Additional OpenType Names
- Generate a clean set of files like SauceCodeProNerdC-MediumItalic.ttf
Then, you'd get the following clean names (based on Source Code Medium Italic)
Family Name: Sauce Code ProNerdC
Style Name: Medium Italic
PS Font Name (the one that was conflicting on a Mac): SauceCodeProNerdC-MediumItalic (it gets automatically shortened to e.g. "It" if it's >~32 symbols)
Full Name: Sauce Code ProNerdC Medium Italic
(OT-Specific names) Mac Name: Sauce Code ProNerdC Medium Italic (though I'm not sure where these OT-specific names are relevant)
No more naming conflicts, no more "NerdFontComplete" in drop-down menus in apps!
Now, this could also be accomplished in FontForge GUI, but would be much more cumbersome. When FontForge allows access by scripts to style names as well, this could all be automated in a script.
I think it might be even possible as is if you can try to guess a style name from a file name or font properties and try to trick FontForge into reading a specially constructed full name (with a hyphen separating name from style) to write the correct style name, but I don't know how FontForge autoguess is working
from nerd-fonts.
I have run into a variant of this issue as well. The script seems to assume the font name is the same as the family name. While the font's I have generated are now organized correctly in Font Book, all variants are generated with the same font name, and Font Book interprets them as Duplicates. The proper method I have found (at least on OS X) is for the style to be included in the font name ("OperatorMonoItalic", for instance).
from nerd-fonts.
Ah yes, there is a special rule for that, need to remember why...
Here Book
is just used as weight. We handle it not as weight.
Also: ExtraLight is not detected as weight extralight
but as name extension extra
and weight light
π€
Edit: Add observation on extralight
from nerd-fonts.
I reported this in #25 which appeared to be fixed, but I didn't actually have a chance to test it because I stopped using the install script in favour of manually installing just the font I use... Would love to see this resolved though!
from nerd-fonts.
Yes this should be fixed.. thanks for the details here.
I don't have a mac to test on but perhaps I can setup a test branch where others can try it out π
from nerd-fonts.
Looks like it's still an issue (shown after installing master
)
from nerd-fonts.
Which, I must say - this project is LEGIT. Really thankful for it!
from nerd-fonts.
Yes this should be fixed.. thanks for the details here
Err I apologize for not making my point clear. π What I meant here was that this should get fixed not that it already was fixed. i.e. Yes this is still a problem AFAIK π
I will be leaving this ticket open until someone can confirm an attempted fix π
Which, I must say - this project is LEGIT. Really thankful for it!
Thanks! That means a lot
from nerd-fonts.
I will be pushing up a test branch that should address this issue. Maybe even as early as tomorrow if I get time.
I will link to it on this ticket when I do.
Thanks
from nerd-fonts.
Actually, was wrong about FontForge not allowing scripting access to all the names β that github ticket threw me off. The sfnt_names
from FF scripting commands is a string that has all the SFNT fields (see Name IDs) and appendSFNTName
command allows to change any of them with either a name ID listed in the link.
So it's possible to do everything inside a FontForge script without the help of any other application (and, more importantly, without having to do any manual adjustments).
from nerd-fonts.
@eugenesvk Yep! I was aware of the sfnt_names
and actually I think I have the changes that should solve the issue right now. Just haven't released or pushed to any branch.
Thank you for the detailed info I think it is helpful π
I think at some point adding configuration files to denote the subfont/style name might be needed. Because some fonts have it after the dash in the filename as a convention but some don't. Also some fonts have the incorrect Styles (SubFamily) when viewed in FontForge (e.g. SourceCodePro-ExtraLight.ttf) as shown below:
WIP Changes preview:
https://gist.github.com/ryanoasis/af51f008838aaa46fb61
particularly of note: sourceFont.appendSFNTName('English (US)', 'SubFamily', subFamily)
from nerd-fonts.
Yeah, Source Code is unfortunately a mess in this regard (I also had to change all the font names for these fonts to be correctly reflected in e.g. ST3 βΒ didn't understand why the same name would work on Mac, but fail to work on a Windows, then realized the font names are inconsistent).
I think the reason why Source Code SubFamily here is Regular instead of ExtraLight is that there is a stupid old convention of limiting styles to 4 (regular, bold, italic, bold italic). So ExtraLight doesn't fit and has to be included in a separate family "Source Code ExtraLight" with Regular/Bold/Italic/BI substyles of its own.
However, the OpenType names of this font are correct (because OT got rid of that 4-style limitation), so in your scripts you'd want to read OpenType names ('Preferred Styles'
and 'Preferred Family'
) instead of just 'SubFamily'
and 'Family'
. And only if OpenType names aren't present, use the regular ones.
Thanks for the gist βΒ I'm also trying to adjust exactly this so that I don't have to do any manual changes, so it's helpful to see what you've done.
And just to reiterate βΒ to me the default FontLab options I've described above are ideal, so I'd suggest you follow them in your scripts as well (overwriting the default Source Code mess, for example), but of course it's up to you.
from nerd-fonts.
I'd also suggest in the output to write OpenType names in addition to the regular ones, as they have a priority (e.g. Mac would display OpenType names over regular ones on conflict, think same is true for Windows, but haven't checked)
A quick reference table from my script (names in comments are from FontLab)
sourceFont.appendSFNTName('English (US)', 'Family', "family") # 'Family Name', 'Menu Name'
sourceFont.appendSFNTName('English (US)', 'SubFamily', "SubFamStyle") # 'Style Name'
sourceFont.appendSFNTName('English (US)', 'Fullname', "fullname") # 'Full Name'
sourceFont.appendSFNTName('English (US)', 'PostScriptName', "PS Name") # 'PS Font Name'
sourceFont.appendSFNTName('English (US)', 'Preferred Family', "PrefFam") # (OT-specific) 'OT Family Name'
sourceFont.appendSFNTName('English (US)', 'Preferred Styles', "PrefSubFam") # (OT-specific) 'OT Style Name'
sourceFont.appendSFNTName('English (US)', 'Compatible Full', "CompatFull") # 'FOND name', (OT-specific) 'Mac Name'
And just FYI similar reference re. default naming functions (FF) is FontForge app names
familyname # (FF) 'Family Name', overwrites 'Family' if not set via appendsfnt
fullname # (FF) 'Name For Humans', overwrites 'Full Name' if not set via appendsfnt
fontname # (FF) 'Fontname', overwrites 'PS Font Name' if not set via appendsfnt"
P.S. Just realized during testing that FontForge introduces another layer of useless quadruplication βΒ the fullname
, familyname
, and fontname
variables are actually NOT the same as any of the SFNT
variables. These are unique names present in the PS Names
menu within 'Font Info' βΒ and these names aren't even visible in other apps (checked FontLab, FontCreator, though can see (FF) 'Family Name' in Mac Glyphs)
from nerd-fonts.
old convention of limiting styles
Did not know this thanks!
read OpenType names [...] And only if OpenType names aren't present, use the regular ones.
Nice. I think I even overlooked that in the screenshot I posted π . Yes I think this makes sense and I this seems like the logic to go with here.
FontLab options
Sorry I did read your suggestion but have not really gone through it in detail. Just FYI the gist I posted was work done before any of your messages so the new information you have provided will help me greatly in making this patcher 'do the right thing'. π
shortening font names always
Also as you mentioned in #58, this one is the only one I am still not sure on. I will reply there
from nerd-fonts.
old convention of limiting styles
That's what I got from that Adobe document
"16 Preferred Family; For historical reasons, font families have contained a maximum of four styles, but font designers may group more than four fonts to a single family. The Preferred Family allows font designers to include the preferred family grouping which contains more than four fonts. This ID is only present if it is different from ID 1."
.
have not really gone through it in detail
I'm basically arguing for three key principles:
- Putting full style (weight, width, and angle) in style name (e.g. Condensed Bold Italic) instead of only doing this for OpenType-specific names and following the useless tradition in regular names. This also means that no style information is contained in the 'Family Name' (no more Source Code Pro ExtraLight as a different family from Source Code Pro)
- Making OpenType-specific names and regular names identical
- Filling in all available naming fields so that you can control the consistency of names along that unnecessary complexity of legacy duplicates
Re. #58 βΒ while thinking about shorter names, don't forget about the larger point of reducing ~36 combinations to 2 :)
from nerd-fonts.
Good stuff thanks again.
Yeah I think I am in agreement with you on all 3 of the main points as you described them.
#58 - yeah that is definitely something to consider. Also claiming a bunch of font variations is a bit deceiving if most of them aren't very useful π
from nerd-fonts.
Just noticed this thread after I created #61, hopefully it's a start towards solving this?
from nerd-fonts.
@jrolfs Yes and I replied on #61, seems like your work at least will help solve. I might have a bit of conflict with https://gist.github.com/ryanoasis/af51f008838aaa46fb61 but I think I soon need to setup a test branch for us to check how the fonts come out.
from nerd-fonts.
Thanks I think we are getting close to getting this fixed now. You are correct it seems that the font name needs the style to identify it properly as a separate font variant.
If you want (and it would be a great help!) you can try patching with the 0.7.0 branch because it seems to be solving most of the issues so far at least.
from nerd-fonts.
Similar / related issue:
Fontname: Example-ReguarItalic
Fontfamily: Example
Name For Humans: ExampleRegularItalic
Weight: Regular
When I generate an .otf file and open it in Fontbook, the font is shown within Example as 'Regular' rather than RegularItalic, meaning it conflicts with the genuine Regular (non-italic) face.
from nerd-fonts.
I'm having similar issues still in the sense that I have several weights of fonts with italics versions however all of the italics get assigned the Bold weight for some reason
from nerd-fonts.
@Undistraction Sorry that I never replied to you. I will test the scenario you mentioned
@Mike3run Can you tell me which fonts you have patched?
from nerd-fonts.
@ryanoasis the Operator Mono font family, so I cannot directly share it but here let me show you a screen capture of the folder with all the patched fonts and on my fontbook program you can see that for example today only the light italic version is detected (up until yesterday it had been the bold version)
from nerd-fonts.
@Mike3run Thanks. Yep no worries I know about that font and yes we will comply with licenses here π
from nerd-fonts.
hey there @ryanoasis just wondering if by any chance this got solved?
Thanks a lot!
from nerd-fonts.
@Mike3run Hey just tested this.. so unfortunately I cannot test on macOS with fontbook but seems to me it might use the weight to differentiate the fonts.
Are you seeing the same issue with unpatched versions of the same font and same weights or does it only occur after patching?
Here is what I see on Linux and it seems to differentiate fine, however there does seem to be something going on:
from nerd-fonts.
@ryanoasis its a bit weird since i mean the font gets actually rendered and you can select it but it will look like other weight.
So even if it says its the light font it will show as bold π€
from nerd-fonts.
also forgot to add, yeah the bug happens only after patching
from nerd-fonts.
@Mike3run Oh! So it's not an issue with some showing up or not showing up as selectable but how the style is rendered?
I wonder if the same thing would happen for you with for instance with Hasklug (Hasklig). It seems to render the correct style/weight for me on Linux:
from nerd-fonts.
Is a mixture of both, on the official fontbook app they do show with names but in a more specialized app like the one on my screenshot above or below they do not show possibly since they are being repeated:
from nerd-fonts.
So you can see on the right I have all the fonts + italic versions but when imported on the italic ones only the light shows up.
On my laptop the same installed fonts make only the bold one show up as italic
from nerd-fonts.
Thanks, this might take some more digging π
from nerd-fonts.
If your system is affected by this, note that having the fonts that Font Book flags as duplicates (i.e.more than a single Italic variant) active will crash iterm2 if you try to set any font from the family in use. Disabling all italic variants but one will resolve the issue.
from nerd-fonts.
But then you wouldn't have bold support :(((((((((((
Although yeah I actually did what you say a year ago and it works
from nerd-fonts.
I'm not happy without bold italic support, but I'd rather have the icons at all than it.
... But as this issue is happening on 1.2.0 still, it might need to be reopened? ( @ryanoasis ? )
from nerd-fonts.
Maybe we can make some traction on this again this month. I won't be able to test any potential fixes but I could upload zips if others (who are on macos) can test them out?
from nerd-fonts.
@ryanoasis Can do! Thanks for looking into it, happy to help with testing out fixes
from nerd-fonts.
+1 this issue is still happening.
from nerd-fonts.
Here's the manual solution to the problem: #257 (comment)
@ryanoasis I think it's just a matter of having better Fontname generators that output shorter names.
from nerd-fonts.
This is implemented/solved since v2.2.0
via --makegroups
command line option.
With v3.0.0
all prepatched fonts will switch their naming to this.
Thanks for the excellent writeup, that I just now found π
from nerd-fonts.
--makegroups
improves but does not totally solve this problem, at least for me.
For example Operator Mono normally comes in 8 styles that FontBook recognizes as a single font:
- Bold
- Bold Italic
- Book
- Book Italic
- Light
- Light Italic
- Medium
- Medium Italic
Patching it with --makegroups
does indeed prevent macos Fontbook from bailing on the duplicated italic names... but it also causes the Book
and Book Italic
styles to be split into an entirely different font (OperatorMonoSSm Book Nerd Font
, vs OperatorMonoSSm Nerd Font
).
Could this be reopened since it's still not fixed?
from nerd-fonts.
Thanks for the feedback.
Can you provide a screenshot of fontbook? Unfortunately I have no MacOS avail.
I assume you self patched, but which fonts? The ones currently in this repo, i.e. at master/HEAD?
from nerd-fonts.
Ah, Operator Mono
...
Trying to reproduce...
Now examining the names
Zoom into the family names:
Family | | Subfamily | | Typogr. Family | | Typogr. Subfamily
------------------------------------------------------- |-| ------------------------------ |-| ---------------------------------------- |-| ----------------------------------------
OperatorMono Book Nerd Font | | Italic | | | |
OperatorMono Book Nerd Font | | Regular | | | |
OperatorMonoExtra Nerd Font Light | | Italic | | OperatorMonoExtra Nerd Font | | Light Italic
OperatorMonoExtra Nerd Font Light | | Regular | | OperatorMonoExtra Nerd Font | | Light
OperatorMono Nerd Font | | Bold Italic | | | |
OperatorMono Nerd Font | | Bold | | | |
OperatorMono Nerd Font Light | | Italic | | OperatorMono Nerd Font | | Light Italic
OperatorMono Nerd Font Light | | Regular | | OperatorMono Nerd Font | | Light
OperatorMono Nerd Font Medium | | Italic | | OperatorMono Nerd Font | | Medium Italic
OperatorMono Nerd Font Medium | | Regular | | OperatorMono Nerd Font | | Medium
Ok, I'll examine.
Thanks for reporting!
from nerd-fonts.
Should be fixed with 3.0.0
from nerd-fonts.
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.
from nerd-fonts.
Related Issues (20)
- BlexMono: doesn't work in Windows HOT 6
- [MonospiceNe NFM] VS Code does not allow 'Mono' font as terminal font HOT 12
- Just found a typo on wiki HOT 3
- Lucide icons solid HOT 3
- Add maple font HOT 1
- CaskaydiaCove Nerd Font -- "Arrow" Ligature HOT 12
- U+276F prompt character (β―) got smaller between 3.1.1 and 3.2.1 HOT 11
- Increase in FA icon size 3.2.0 to 3.2.1 HOT 7
- Semi-Systematic Logo-Addition Evaluation HOT 2
- Font request: Space Grotesk HOT 1
- Should CaskaydiaCove (nerd version of Cascadia) be replaced with the official nerd version? HOT 2
- Large glyphs in MesloLGS NF for catppuccin/tmux HOT 2
- Glyph e27f (nf-fae-atom) in "Cascadia Code NF" is filled in some areas where it should not be HOT 1
- Incorrect (?) width of glyph(s) in RobotoMono Font HOT 1
- Missing 1px line at the top of upper-left and upper-right triangles HOT 13
- ShureTechMono "fi" text overlap. HOT 10
- Deprecation warning for `appcast` in `font-sourcecodepro-nerd-font` HOT 4
- Update 0xProto to 2.0 HOT 1
- Homebrew/cask-fonts will soon be deprecated HOT 2
- Tilde character in Inconsolata font looks off HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nerd-fonts.