be5invis / Iosevka

Versatile typeface for code, from code.
http://be5invis.github.io/Iosevka
SIL Open Font License 1.1
19.17k stars 570 forks source link

building from source on linux (trying to create an official debian package) #715

Open alexmyczko opened 3 years ago

alexmyczko commented 3 years ago

The problem is npm during build downloads stuff. How easy would it be to turn the downloads off and still use the same build system? How hard to switch to another build system?

http://sid.ethz.ch/debian/fonts-iosevka/

(Debian builds may not access internet during build)

alerque commented 3 years ago

Fontship would be one alternative build system for this, but that isn't packaged on Debian yet either. The build tooling for this repo is considerably more complicated than your average Font repo. Switching it out for something else will not be trivial.

NPM allows for offline usage by specifying a module cache dir and warming it up with the necessary packages in a pre-build step, then builds can happen offline. I know Debian does this for other packages (as does Arch Linux).

alexmyczko commented 3 years ago

Ok fontship you say here we go fontship -V says fontship v0.6.2, it was fun to build from source... with npm build i'd download one half of the internet, and to build fontship (cargo) it would download the other half of the internet.

ok, now what?

alerque commented 3 years ago

Ha ha. You forgot about the half that pip would need to download ;-)

Now what? This font project isn't arranged quite right to use it yet. Someday I'll look at porting the current build rules for the various flavors of the font to Fontship rules. I wasn't proposing you could build this font with it now, just that it is an alternative build system that could be considered for the project. Just like many C++ projects could be built with either CMake or GNU Make or Meson but projects typically only support one of the above, so for font projects. Most projects use totally hand baked (or copy pasted) build scripts and a hodge-podge of Python stuff. With Fontship I'm trying to organize that a bit into best practices for automated font builds so that a bunch of Mac based designer types don't have to keep re-inventing the wheel on the code side.

This font project is a bit more advanced than most though, so it's not the one I'm starting with.

be5invis commented 3 years ago

Well, this font is just a huge Node.Js program that generates TTF, and all the geometries are procedurally generated. It may be possible to do a rollup for all the JS it depends into a single file, and calling it via CLI or a thin wrapper. Put into 4.x.

alexmyczko commented 3 years ago

I would only need to build ttf with autohint, or better otf but i could not find otf building support..

how likely would it fit before end of year to match https://release.debian.org/bullseye/freeze_policy.html ?

be5invis commented 3 years ago

@alexmyczko I do not think I have enough bandwidth on that.

alexmyczko commented 1 year ago

meanwhile i missed the bookworm freeze, while others have it https://repology.org/project/fonts:iosevka/versions

and my sid.ethz.ch repo has 22.0.0 now

for reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973995

hackerb9 commented 7 months ago

meanwhile i missed the bookworm freeze, while others have it https://repology.org/project/fonts:iosevka/versions

and my sid.ethz.ch repo has 22.0.0 now

The link from the Iosevka README.md goes to phd-sid.ethz.ch which is stuck on version 7. Is that fixable? Thanks!

alexmyczko commented 7 months ago

@hackerb9 the link really is sid.ethz.ch, please don't call it phd-sid (this is an internal name that can change any time, i'm not authority for it, but sid is mine)

Anyways, the main problem is that our web server is not configured to sort the way convenient for human beings, but if you do this:

links2 -dump sid.ethz.ch/debian/fonts-iosevka |sort -V

it's a bit better and shows there's packaging for 22.0.0. for transparency and efficiency (not wasting time removing old stuff), i keep old stuff around (which i look up for reasons)

HTH

hackerb9 commented 7 months ago

Okay. I think I understand now.

The README for Iosevka directly links to phd-sid. The code reads:

 * Ubuntu Linux: Install one of the [fonts-iosevka packages](http://phd-sid.ethz.ch/debian/fonts-iosevka/).

Is it worth filing a new issue for this with the Iosevka project?

(By the way, thank you for creating a Debian package! I hope it gets accepted into the official repository soon.)

alexmyczko commented 7 months ago

https://github.com/be5invis/Iosevka/issues/715#issuecomment-723037191

it will not unless someone fixes the building part. building is building, not downloading stuff from internet (forbidden).

hackerb9 commented 6 months ago

#715 (comment)

it will not unless someone fixes the building part. building is building, not downloading stuff from internet (forbidden).

While I certainly would prefer a package that generates the font, I thought that wasn't a strict requirement for Debian. For example, fonts-terminus (which is under the SIL Open Font License) just copies the .ttf.

The Debian Font Packaging Policy Wiki does not directly mention building but does link to a draft of a Debian fonts-policy which reads:

Generation of binary packages

To preserve the forms of the fonts as intended by the original authors, packagers MAY opt, for fonts distributed in a final, usable form (e.g., .ttf, .otf etc.), to ship those files in the binary packages, without any build step.

For packages that only provide sources in Fontforge's format, custom scripts MAY be used, if upstream does not provide them.

Despite the suggestion of shipping fonts that are as close as possible to what upstream ships, some manipulation is allowed and even encouraged, for the removal of glyphs for reduction of the size to fit in installation media.

In any case, the package SHOULD clearly state that the font was manipulated in the README.Debian file of the generated binary package.

Would it be possible to release an interim package using the binary files, at least until the building part works?

alexmyczko commented 6 months ago

Yes that is absolutely possible, but then I prefer the fnt tool which works on Debian and macOS, and according the issues there is a plan to have own sources as in any URL... https://github.com/alexmyczko/fnt

I will need some time, what is frustrating is building it from source is good, but I don't remember what was not good about it. It can not easily be fixed?

be5invis commented 6 months ago

If you look into the DistUnhintedTTF recipe in verdafile you could find it eventually does a "function call" to packages/font/src/index.mjs with some parameters as a JSON object. Maybe you can try capture it and call it with a bundled version of packages/font/src/index.mjs...

(But, well I am not good at dealing with bundlers, so you may need to write a github action that syncs Iosevka and creates the bundled JS file.)

josch commented 2 months ago

@alexmyczko the link seems to be 404 right now. Can this be fixed? Thanks!

alexmyczko commented 2 months ago

@josch sorry about the outage, it's back

alexmyczko commented 2 months ago

just for the record, it has been found too big to package the font directly. and source build would be preferred, but as long as "verda" is not packaged, this won't happen (not from me)