Closed tukanoidd closed 1 month ago
Rio version 0.1.10 (using repo flake, updated today, locked at 8e424d429076714d1462e8e88a3e64f6dd33aa1e)
Fonts - nixpkgs#nerdfonts & nixpkgs#iosevka-comfy.comfy-fixed
In case you decide to use my nushell function to check for the needed info, here's an updated version that has some filtering of which font data to display (/nix/store/path/to/font's are too long) can also automatically convert weights to non-fc values
def "fonts weight non-fc" [weight:int] {
let weight_non_fc_converter = [
{from: 0, to: 100},
{from: 40, to: 200},
{from: 50, to: 300},
{from: 55, to: 350},
{from: 75, to: 380},
{from: 80, to: 400},
{from: 100, to: 500},
{from: 180, to: 600},
{from: 200, to: 700},
{from: 205, to: 800},
{from: 210, to: 900},
{from: 215, to: 1000},
];
let convert = $weight_non_fc_converter | find -c ["from"] $weight
if ($convert | is-empty) {
$weight
} else {
$convert.to | get 0
}
}
def "fonts info weight" [
family: string
--path = false,
--names = false
--styles = false
--non-fc-values=false
] {
let no_filters = (not $path) and (not $names) and (not $styles);
let filters = {path: $path, names: $names, styles: $styles}
(fc-list :family=($family) weight)
| split row "\n"
| each {$in | split row "=" | get 1 | str trim}
| each {|$weight_str|
let weight = if ($weight_str | str starts-with '[') {
let last = ($weight_str | str length) - 2
let weights = $weight_str | str substring 1..$last | split row " "
let weight = $weights | each {$in | into int}
if $non_fc_values {
$weight | each {fonts weight non-fc $in}
} else {
$weight
}
} else {
let weight = $weight_str | into int
if $non_fc_values {
fonts weight non-fc $weight
} else {
$weight
}
};
let weight_fonts = (fc-list :weight=($weight_str))
| split row "\n"
| filter {$in | str contains $family}
| each {
let path_names_styles = $in | split row ": "
let path = $path_names_styles | get 0
let names_styles = $path_names_styles | get 1 | split row ":style="
let names = $names_styles | get 0 | split row ","
let styles = $names_styles | get 1 | split row ","
if $no_filters {
return {path: $path, names: $names, styles: $styles}
}
mut res = {}
if $filters.path {
$res = $res | insert path {$path}
}
if $filters.names {
$res = $res | insert names {$names}
}
if $filters.styles {
$res = $res | insert styles {$styles}
}
$res
}
{weight: $weight, fonts: $weight_fonts}
}
}
tried setting session variables as was said in the issue, but didnt seem to do anything
Found this (tracking to the PR with SOME font fixes), when it lands in nixpkgs-unstable (can't risk with using master branch, im not that crazy :laughing: )
Thanks for the heads up and debug @tukanoidd ! Question: When do specify weight in other fonts, does it works? or is only this one
uh, i cant tell atm, i tried to update my system again in hopes the issue was fixed (b4 i found out about the tracker) and currently fc-list shows only 1 DejaVu font available for some reason, and none from these which is confusing, as it was showing them yesterday
Ok, thats weird, they only show up with sudo now? What
Finally managed to get it working, have to use nixos-unstable-small nixpkgs branch until the fixes land in nixos-unstable finally, sorry for creating this issue without doing proper research first
No worries at all @tukanoidd Just glad is working now
No worries at all @tukanoidd Just glad is working now
Same, I really like the terminal, been following since 0.0.x days, just couldn't use it in my environment until it hit 0.1 (prolly better compat with Wayland in Sugarloaf?), very happy with it.
❤️
@raphamorim hey, having this isuse with a different font, "JetBrainsMono NerdFont", on NixOS. The fonts did indeed change, I used fc-list to ensure I changed to the right names/weights/styles, but it still can't find them.
Here's my nix config snippet:
To make it easier for myself, I created this nushell function:
That, with
fonts info weight "JetBrainsMono NF" --styles=true --names=true | to json
returns:Tried both Nerd Font and NF variant, both fail.
I also made sure it's not coming from Iosevka font, if I run
fonts info weight "Iosevka Comfy Fixed" --styles=true --names=true | to json
:the font is found without an issue.
Does it have something to do with weights being so small compared to the ones used in the docs? Before i did use to have 400/800 but since fc-list showed be smaller values, I used them. Or are those values from fc-list inaccurate?
Edit after checking info regarding weights reported by fc-list: based on the mappings described here https://stackoverflow.com/questions/50662370/font-weights-as-reported-by-fc-list-not-expected-what-do-i-use-for-google-fonts, I changed Regular & Italic to 400, Bold to 700, same error.
Also, here's a screenshot of the error just in case if that can somehow help with determining the issue (me doing a dumb typo or using wrong casing for styles etc)