Open pinpox opened 2 years ago
Personally, I would prefer to see ttf-iosevka
and woff2-iosevka
(but for all fonts). From the OS perspective, webfonts are not ideal or useful. And on the web, due to size, you should probably only serve up *.woff2
files (as of writing)--all other formats are too large to ethically serve to users (i.e. *.ttf
, *.otf
, *.woff
). As such, I don't know that there's a use case I as a user would want both traditional and web formats together.
If it helps, I've been using a function like
mkWOFF2From = { name, pkg, ext }: pkgs.stdenvNoCC.mkDerivation {
name = "${name}-woff2";
nativeBuildInputs = [ pkgs.fontforge pkg ];
dontInstall = true;
unpackPhase = ''
WOFF2_DIR="$out/share/fonts/woff2/"
mkdir -p "$WOFF2_DIR"
for file in ${pkg}/share/fonts/truetype/*.${ext}; do
NAME="$(basename $file .${ext})"
fontforge --lang=ff \
-c 'Open($1); Generate($2);' \
"$file" \
"$WOFF2_DIR/$NAME.woff2"
done
'';
};
Why is there a need for a custom function? Since the build command of iosevka (linked above) can be customized to output any selection of the desired formats, I don't see why it would hurt to add the choice with a sensible default.
Since we are passing parmaters with defaults already here in the package it seems like a simple solution to add a outputFormats
option or simlilar that can be any of the formats described in the iosevka customized build options (contents
, ttf
, ttf-unhinted
, webfont
, etc.) and using it here instead of hard-coding ttf
.
I don't see why it would hurt to add the choice with a sensible default.
Oh, I don't disagree. TTF is likely a best default. I would only be wary of building WOFF2 for user's desktop systems too. I believe some of the fonts in Nixpkgs do build at multiple types which wastes quite a bit of space on the machine.
I think this might be a good use case for split-output derivations? Leave traditional fonts in out
and put web fonts in a separate woff2
output?
EDIT: apparently the place for such a discussion would be https://github.com/NixOS/nixpkgs/pull/91518, which seems dead
If it were me, I'd love to see fonts.iosevka
and webfonts.iosevka
or something like this.
Describe the bug
Not strictly a bug, but other types of issue didn't fit. The iosevka package is missing the webfont and has no option to include it
Steps To Reproduce
Steps to reproduce the behavior:
iosevka
packageExpected behavior
Either have the webfont files included per default or include them optionally
Additional context
The font is build here using this command
To include the other formats like the webfont variant, the command would have to be:
There are even more variants documented here but I think the option to include all of them with
contents::..
would be useful. My usecase is using the webfont as part of building a static blog.Notify maintainers
@cstrahan @jfrankenau @ttuegel @babariviere @rileyinman @AluisioASG
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.