-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Different font weights than unpatched font #1818
Comments
The patching should not touch the weight. Can you give more concrete information? Which of the Ubuntu fonts do you mean, and which files concretely? Ubuntu comes in 'new' and 'old', and if I remember correctly something with the weight changed there too (because the new font is originally a VF) 🤔 |
/usr/share/fonts/ubuntu/UbuntuMono-R.ttf and /usr/share/fonts/TTF/UbuntuNerdFont-Regular.ttf. On archlinux it comes from ttf-ubuntu-font-family and ttf-ubuntu-nerd packages. Try all font weights like this:
|
Hmm,
The left one is Lets look into the packages... Okay, $ tree -P '*.ttf' src/unpatched-fonts/Ubuntu*
src/unpatched-fonts/Ubuntu
├── Bold
│ └── Ubuntu-B.ttf
├── Bold-Italic
│ └── Ubuntu-BI.ttf
├── Condensed
│ └── Ubuntu-C_modified.ttf
├── Light
│ └── Ubuntu-L.ttf
├── Light-Italic
│ └── Ubuntu-LI.ttf
├── Medium
│ └── Ubuntu-M.ttf
├── Medium-Italic
│ └── Ubuntu-MI.ttf
├── Regular
│ └── Ubuntu-R.ttf
└── Regular-Italic
└── Ubuntu-RI.ttf
src/unpatched-fonts/UbuntuMono
├── Bold
│ └── UbuntuMono-B.ttf
├── Bold-Italic
│ └── UbuntuMono-BI.ttf
├── Regular
│ └── UbuntuMono-R.ttf
└── Regular-Italic
└── UbuntuMono-RI.ttf
src/unpatched-fonts/UbuntuSans
├── Mono
│ ├── UbuntuSansMono-BoldItalic.ttf
│ ├── UbuntuSansMono-Bold.ttf
│ ├── UbuntuSansMono-Italic.ttf
│ ├── UbuntuSansMono-MediumItalic.ttf
│ ├── UbuntuSansMono-Medium.ttf
│ ├── UbuntuSansMono-Regular.ttf
│ ├── UbuntuSansMono-SemiBoldItalic.ttf
│ └── UbuntuSansMono-SemiBold.ttf
└── Sans
├── UbuntuSans-BoldItalic.ttf
├── UbuntuSans-Bold.ttf
├── UbuntuSans-Italic.ttf
├── UbuntuSans-MediumItalic.ttf
├── UbuntuSans-Medium.ttf
├── UbuntuSans-Regular.ttf
├── UbuntuSans-SemiBoldItalic.ttf
└── UbuntuSans-SemiBold.ttf Ok, lets examine the weights of the old Ubuntu fonts, unpatched:
Lets make that list more concise to match your list
Which is strange, Medium should be 500 [1] and it (you) claim the next font is only 600 🤔 And examine the patched fonts
Ah!! [1] https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping Edit: Add link to name-number mapping |
This html thing seems to take the weights from the file name and not from the embedded metadata (o_O) Why is the Medium font not detected as
Ah, it abbreviates Well, still the behavior you describe is exactly what I would expect:
As we have fonts with 300, 400, 500, and 700. |
So, trying to reproduce, this is localinstalled $ fc-list | grep 'Ubuntu Nerd Font[^ ]' | grep -vi 'italic'
/home/fini/.local/share/fonts/UbuntuNerdFont-Regular.ttf: Ubuntu Nerd Font:style=Regular
/home/fini/.local/share/fonts/UbuntuNerdFont-Bold.ttf: Ubuntu Nerd Font:style=Bold
/home/fini/.local/share/fonts/UbuntuNerdFont-Condensed.ttf: Ubuntu Nerd Font,Ubuntu Nerd Font Cond:style=Condensed,Regular
/home/fini/.local/share/fonts/UbuntuNerdFont-Medium.ttf: Ubuntu Nerd Font,Ubuntu Nerd Font Med:style=Medium,Regular
/home/fini/.local/share/fonts/UbuntuNerdFont-Light.ttf: Ubuntu Nerd Font,Ubuntu Nerd Font Light:style=Light,Regular Which is all good and well, as expected. Now trying to set up with the old Ubuntu font, which is a bit of a hassle because I have the new Ubuntu font system-installed... $ fc-list | grep 'Ubuntu[^[NMS ]' | grep -vi 'italic'
/usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf: Ubuntu,Ubuntu Light:style=Light,Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-Th.ttf: Ubuntu,Ubuntu Thin:style=Thin,Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-B.ttf: Ubuntu:style=Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf: Ubuntu:style=Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf: Ubuntu,Ubuntu Light:style=Medium,Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu-C.ttf: Ubuntu Condensed:style=Regular So there is a new one at 200, but still 300, 400, 500, and 600. So I must say I can not reproduce 🤔 Just documenting, this is how it's with the new Ubuntu font: $ fc-list | grep 'Ubuntu[^[NMS ]' | grep -vi 'italic'
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Regular
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Medium
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed Thin
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Light
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed Medium
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Extra Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed Extra Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed Light
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Thin
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Bold
/usr/share/fonts/truetype/ubuntu/Ubuntu[wdth,wght].ttf: Ubuntu:style=Condensed Bold My "setup": $cat ~/x.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="x.css">
<title>Page Title</title>
</head>
<body>
<p class="w100">This is weight 100</p>
<p class="w200">This is weight 200</p>
<p class="w300">This is weight 300</p>
<p class="w400">This is weight 400</p>
<p class="w500">This is weight 500</p>
<p class="w600">This is weight 600</p>
<p class="w700">This is weight 700</p>
<p class="w800">This is weight 800</p>
<p class="w900">This is weight 900</p>
</body>
</html> $ cat ~/x.css
body { font-family: 'Ubuntu'; }
.w100 { font-weight: 100; }
.w200 { font-weight: 200; }
.w300 { font-weight: 300; }
.w400 { font-weight: 400; }
.w500 { font-weight: 500; }
.w600 { font-weight: 600; }
.w700 { font-weight: 700; }
.w800 { font-weight: 800; }
.w900 { font-weight: 900; } |
In your last post I'm getting the same thing for the first screenshot for Ubuntu Nerd Font. Your last screenshot is different from what I get for Ubuntu. In firefox dev tools what do you see when you click on the Inspector Fonts what does it say for you? First 3 are Ubuntu / Ubuntu Light |
This is with the 'old' Ubuntu font installed Kooha-2025-03-26-21-49-01.mp4100 - 200 Ubuntu Thin Maybe you can upload your Medium font file in a comment here (put into a zip) and I check if it's the same as mine? |
Fonts used for the tests above (Ubuntu system package)$ sha256sum /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf
e801a0867295367000c6dd3c337622ae4aaff85786ddbfbdb985ce774fe3cd62 /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf
$ ll /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf
-rw-r--r-- 1 root root 341324 Jul 10 2015 /usr/share/fonts/truetype/ubuntu/Ubuntu-M.ttf $ LC_ALL=C ll /usr/share/fonts/truetype/ubuntu
total 4308
-rw-r--r-- 1 root root 333612 Jul 10 2015 Ubuntu-B.ttf
-rw-r--r-- 1 root root 356980 Jul 10 2015 Ubuntu-BI.ttf
-rw-r--r-- 1 root root 350444 Jul 10 2015 Ubuntu-C.ttf
-rw-r--r-- 1 root root 415552 Jul 10 2015 Ubuntu-L.ttf
-rw-r--r-- 1 root root 409608 Jul 10 2015 Ubuntu-LI.ttf
-rw-r--r-- 1 root root 341324 Jul 10 2015 Ubuntu-M.ttf
-rw-r--r-- 1 root root 366992 Jul 10 2015 Ubuntu-MI.ttf
-rw-r--r-- 1 root root 353824 Jul 10 2015 Ubuntu-R.ttf
-rw-r--r-- 1 root root 386440 Jul 10 2015 Ubuntu-RI.ttf
-rw-r--r-- 1 root root 240020 Feb 18 2022 Ubuntu-Th.ttf
-rw-r--r-- 1 root root 191400 Sep 26 2011 UbuntuMono-B.ttf
-rw-r--r-- 1 root root 216208 Sep 26 2011 UbuntuMono-BI.ttf
-rw-r--r-- 1 root root 205748 Sep 26 2011 UbuntuMono-R.ttf
-rw-r--r-- 1 root root 210216 Sep 26 2011 UbuntuMono-RI.ttf Ubuntu package name is Fonts used by Nerd Font project$ sha256sum src/unpatched-fonts/Ubuntu/Medium/Ubuntu-M.ttf
e801a0867295367000c6dd3c337622ae4aaff85786ddbfbdb985ce774fe3cd62 src/unpatched-fonts/Ubuntu/Medium/Ubuntu-M.ttf $ LC_ALL=C ll src/unpatched-fonts/Ubuntu/**/*.ttf src/unpatched-fonts/UbuntuMono/**/*.ttf
-rw-rw-r-- 1 fini fini 356980 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Bold-Italic/Ubuntu-BI.ttf
-rw-rw-r-- 1 fini fini 333612 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Bold/Ubuntu-B.ttf
-rw-rw-r-- 1 fini fini 350444 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Condensed/Ubuntu-C_modified.ttf
-rw-rw-r-- 1 fini fini 409608 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Light-Italic/Ubuntu-LI.ttf
-rw-rw-r-- 1 fini fini 415552 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Light/Ubuntu-L.ttf
-rw-rw-r-- 1 fini fini 366992 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Medium-Italic/Ubuntu-MI.ttf
-rw-rw-r-- 1 fini fini 341324 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Medium/Ubuntu-M.ttf
-rw-rw-r-- 1 fini fini 386440 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Regular-Italic/Ubuntu-RI.ttf
-rw-rw-r-- 1 fini fini 353824 Jan 5 16:39 src/unpatched-fonts/Ubuntu/Regular/Ubuntu-R.ttf
-rw-rw-r-- 1 fini fini 216208 Jan 5 16:39 src/unpatched-fonts/UbuntuMono/Bold-Italic/UbuntuMono-BI.ttf
-rw-rw-r-- 1 fini fini 191400 Jan 5 16:39 src/unpatched-fonts/UbuntuMono/Bold/UbuntuMono-B.ttf
-rw-rw-r-- 1 fini fini 210216 Jan 5 16:39 src/unpatched-fonts/UbuntuMono/Regular-Italic/UbuntuMono-RI.ttf
-rw-rw-r-- 1 fini fini 205748 Jan 5 16:39 src/unpatched-fonts/UbuntuMono/Regular/UbuntuMono-R.ttf Firefox used(This is the Debian package one, usually Ubuntu uses some snap crap.) Edit: Use C locale for sane sort |
Well, in that comment (#1818 (comment)) I have three screenshots.
So the last screenshot must be different, because you use the old Ubuntu fonts. |
Is the 3rd font in the archlinux repo like the other fonts (ttf-ubuntu-font-family and ttf-ubuntu-nerd)? |
Requirements
Experienced Behavior
Tried Ubuntu and Ubuntu Nerd Font for the same pages on the web.
Ubuntu displays 4 font-weights
Ubuntu Nerd Font displays 4 font-weights but they were changed
Expected Behavior
Ubuntu Nerd Font should use the same weights as Ubuntu so things look same on the web and it can be a drop in replacement.
Example Symbols or Text
No response
Font Used
No response
Source of Font File
No response
Terminal Emulator (and the title of the terminal window)
No response
Operating System and Version
No response
Screenshots
No response
The text was updated successfully, but these errors were encountered: