Skip to content
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

Customization isn't applied: weights filter doesn't work; ligations variant "javascript" gets ignored #1340

Closed
OnkelTem opened this issue Apr 23, 2022 · 23 comments

Comments

@OnkelTem
Copy link

OnkelTem commented Apr 23, 2022

I use the following config:

[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
no-cv-ss = true

  [buildPlans.iosevka-custom.ligations]
  inherits = "javascript"

[buildPlans.iosevka-custom.weights.regular]
shape = 400
menu = 400
css = 400

[buildPlans.iosevka-custom.weights.semibold]
shape = 600
menu = 600
css = 600

[buildPlans.iosevka-custom.widths.normal]
shape = 600
menu = 5
css = "normal"

and docker for building my font:

$ docker run -it -v $(pwd):/build avivace/iosevka-build ttf::iosevka-custom

But on the output I get all weights including thin and extrabold.

Another problem is that triple = (===) results to two lines while according to the "javascript" variants template there should be three.

image

Also I noticed that two long lines in long = have gaps inside. They are distinguishable on the screenshot.

The third problem is that Width Option isn't applied as well. Changing it to Standard/Extended doesn't make any difference.

My VSCode font config:

  "editor.fontFamily": "Iosevka",
  "editor.fontLigatures": true,
  "editor.fontSize": 16,

P.S. Why there goes an indent in the [buildPlans.iosevka-custom.ligations] line here?

image

@OnkelTem OnkelTem changed the title Customization isn Customization isn't applied: weights filter doesn't work; ligations get ignored Apr 23, 2022
@OnkelTem OnkelTem changed the title Customization isn't applied: weights filter doesn't work; ligations get ignored Customization isn't applied: weights filter doesn't work; ligations variant "javascript" gets ignored Apr 23, 2022
@be5invis
Copy link
Owner

Can you try building this without using Docker?

@alexeyten
Copy link
Contributor

You’ve built Iosevka Custom, but use Iosevka in your config.

@jamapy
Copy link

jamapy commented May 2, 2022

I have try to build, not use docker, using the config and the result is correct. Only produce regular and semibold weight with italic and oblique variants.

@OnkelTem
Copy link
Author

OnkelTem commented May 2, 2022

Ok guys, let me try one more time, from scratch.

@OnkelTem
Copy link
Author

OnkelTem commented May 2, 2022

So I rebuilt the fonts and tried to use them in VSCode.
It didn't work.

This time I used a config like:

[buildPlans.iosevka-slab-123]
family = "IosevkaSlab"
spacing = "normal"
serifs = "slab"
no-cv-ss = true

  [buildPlans.iosevka-slab-123.ligations]
  inherits = "javascript"

[buildPlans.iosevka-slab-123.weights.regular]
shape = 400
menu = 400
css = 400

[buildPlans.iosevka-slab-123.weights.semibold]
shape = 600
menu = 600
css = 600

and it generated these files in the ./dist/ttf/:

iosevka-slab-123-extendeditalic.ttf
iosevka-slab-123-extendedoblique.ttf
iosevka-slab-123-extendedsemibolditalic.ttf
iosevka-slab-123-extendedsemiboldoblique.ttf
iosevka-slab-123-extendedsemibold.ttf
iosevka-slab-123-extended.ttf
iosevka-slab-123-italic.ttf
iosevka-slab-123-oblique.ttf
iosevka-slab-123-regular.ttf
iosevka-slab-123-semibolditalic.ttf
iosevka-slab-123-semiboldoblique.ttf
iosevka-slab-123-semibold.ttf

Then I copied them into ~/.fonts and updated the fc-cache:

$ fs-list | grep IosevkaSlab
~/.fonts/fonts/iosevka-slab-123-extendedoblique.ttf: IosevkaSlab,IosevkaSlab Extended Oblique:style=Extended Oblique,Regular
~/.fonts/fonts/iosevka-slab-123-extendeditalic.ttf: IosevkaSlab,IosevkaSlab Extended:style=Extended Italic,Italic
~/.fonts/fonts/iosevka-slab-123-regular.ttf: IosevkaSlab:style=Regular
~/.fonts/fonts/iosevka-slab-123-semiboldoblique.ttf: IosevkaSlab,IosevkaSlab Semibold Oblique:style=Semibold Oblique,Regular
~/.fonts/fonts/iosevka-slab-123-extendedsemiboldoblique.ttf: IosevkaSlab,IosevkaSlab SmBdExObl:style=Semibold Extended Oblique,Regular
~/.fonts/fonts/iosevka-slab-123-extendedsemibolditalic.ttf: IosevkaSlab,IosevkaSlab Semibold Extended:style=Semibold Extended Italic,Italic
~/.fonts/fonts/iosevka-slab-123-semibolditalic.ttf: IosevkaSlab,IosevkaSlab Semibold:style=Semibold Italic,Italic
~/.fonts/fonts/iosevka-slab-123-extended.ttf: IosevkaSlab,IosevkaSlab Extended:style=Extended,Regular
~/.fonts/fonts/iosevka-slab-123-extendedsemibold.ttf: IosevkaSlab,IosevkaSlab Semibold Extended:style=Semibold Extended,Regular
~/.fonts/fonts/iosevka-slab-123-semibold.ttf: IosevkaSlab,IosevkaSlab Semibold:style=Semibold,Regular
~/.fonts/fonts/iosevka-slab-123-oblique.ttf: IosevkaSlab,IosevkaSlab Oblique:style=Oblique,Regular
~/.fonts/fonts/iosevka-slab-123-italic.ttf: IosevkaSlab:style=Italic

But after that, IosevkaSlab is still not available in VSCode.

See the video:

https://www.youtube.com/watch?v=jcBZxwSqlRA

@be5invis
Copy link
Owner

be5invis commented May 2, 2022

@OnkelTem The files produced look correct (you didn't override widths so you will have 12 files produced). As for Code, maybe... you need to restart Code to let it "see" newly installed fonts?

@OnkelTem
Copy link
Author

OnkelTem commented May 2, 2022

@be5invis, and you're right! vscode just needed to be restarted! Now it works with the added "IosevkaSlab" font.
Damn, such a silly thing. I'm ashamed...

But you know, what I don't get, is that in my previous attempts I used the default font family name "Iosevka Custom". But this is how they are displayed with fc-list:

$ fc-list | grep Iosevka | grep -v IosevkaSlab | head 
/home/fantomas/.fonts/fonts/iosevka-extrabolditalic.ttf: Iosevka,Iosevka Extrabold:style=Extrabold Italic,Italic
/home/fantomas/.fonts/fonts/iosevka-semibold.ttf: Iosevka,Iosevka Semibold:style=Semibold,Regular
/home/fantomas/.fonts/fonts/iosevka-medium.ttf: Iosevka,Iosevka Medium:style=Medium,Regular
/home/fantomas/.fonts/fonts/iosevka-bold.ttf: Iosevka:style=Bold
/home/fantomas/.fonts/fonts/iosevka-mediumoblique.ttf: Iosevka,Iosevka Medium Oblique:style=Medium Oblique,Regular
/home/fantomas/.fonts/fonts/iosevka-extendeditalic.ttf: Iosevka,Iosevka Extended:style=Extended Italic,Italic
/home/fantomas/.fonts/fonts/iosevka-italic.ttf: Iosevka:style=Italic
/home/fantomas/.fonts/fonts/iosevka-extralightoblique.ttf: Iosevka,Iosevka Extralight Oblique:style=Extralight Oblique,Regular
/home/fantomas/.fonts/fonts/iosevka-extralightitalic.ttf: Iosevka,Iosevka Extralight:style=Extralight Italic,Italic
/home/fantomas/.fonts/fonts/iosevka-extendedthinoblique.ttf: Iosevka,Iosevka Thin Extended Oblique:style=Thin Extended Oblique,Regular

As you see, there is no the "Custom" word in the font names. VSCode also "confirms" this: setting "editor.fontFamily": " 'Iosevka Custom' " doesn't work.

Ideas?

P.S. I plan to write an article on configuring and using the font afterwards.

@jamapy
Copy link

jamapy commented May 3, 2022

[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
no-cv-ss = true

  [buildPlans.iosevka-custom.ligations]
  inherits = "javascript"

[buildPlans.iosevka-custom.weights.regular]
shape = 400
menu = 400
css = 400

[buildPlans.iosevka-custom.weights.semibold]
shape = 600
menu = 600
css = 600

[buildPlans.iosevka-custom.widths.normal]
shape = 600
menu = 5
css = "normal"

Using this config shoud produce file with name iosevka-custom-* in dist/iosevka-custom/ttf directory. Here is my build using the script:

$ fc-list | grep 'Iosevka Custom'
/home/moses/.local/share/fonts/ttf/iosevka-custom-regular.ttf: Iosevka Custom:style=Regular
/home/moses/.local/share/fonts/ttf/iosevka-custom-semibold.ttf: Iosevka Custom,Iosevka Custom Semibold:style=Semibold,Regular
/home/moses/.local/share/fonts/ttf/iosevka-custom-semiboldoblique.ttf: Iosevka Custom,Iosevka Custom SmBdObl:style=SemiboldOblique,Regular
/home/moses/.local/share/fonts/ttf/iosevka-custom-semibolditalic.ttf: Iosevka Custom,Iosevka Custom Semibold:style=SemiboldItalic,Italic
/home/moses/.local/share/fonts/ttf/iosevka-custom-italic.ttf: Iosevka Custom:style=Italic
/home/moses/.local/share/fonts/ttf/iosevka-custom-oblique.ttf: Iosevka Custom,Iosevka Custom Oblique:style=Oblique,Regular

IMO, don't use "Custom", use something unique to make debugging easier.

@OnkelTem
Copy link
Author

OnkelTem commented May 3, 2022

For some reason your docker image stopped working on my machine.
I've never seen anything like this.

While I can run other images, e.g. https://hub.docker.com/_/hello-world :

$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.
...

I cannot run the font builder anymore:

$ docker -D run -it -v $(pwd):/build avivace/iosevka-build ttf::iosevka-custom
DEBU[0008] [hijack] End of stdout

@OnkelTem
Copy link
Author

OnkelTem commented May 3, 2022

Ok, it becomes really weird.
I've just initialized a new virtual box with Vagrant (Ubuntu 20.04), installed the latest CE docker there, and I still have this problem.
So what has changed since yesterday?
DockerHub says the image was last updated a year ago: https://hub.docker.com/r/avivace/iosevka-build

I'm totally confused.

@OnkelTem
Copy link
Author

OnkelTem commented May 3, 2022

I concluded that if it's not the docker/image issue, than it's a problem of what the container is actually doing.
I enabled a VPN and a big delay has appeared after launching the command, after which the command silently fails anyway.
But at least it's now obvious that the docker image depends on some remote party which is failing.

So it's now a matter of another ticket, about proper error messaging.

@OnkelTem
Copy link
Author

OnkelTem commented May 3, 2022

Sorry for this thread becomes a little messy.
I created a follow-up here: avivace/iosevka-docker#10

@OnkelTem
Copy link
Author

OnkelTem commented May 3, 2022

The build process seems to be screwed up.
I don't get customized files on the output.
I tried many times with different options, but I couldn't even reproduce what reportedly worked for @jamapy.
The filenames ain't being changing from the default ones.
The font family is ignored.
It creates WOFF2 files which are I don't request to be generated.
So the filters in the .toml don't get applied.

I used docker thing. Are you @jamapy also using docker?

I tried to fetch the repo itself but for several hours it hasn't been downloaded (32Gb).

Sorry I'm giving up.

@jamapy
Copy link

jamapy commented May 4, 2022

Sorry @OnkelTem I don't use docker. Just plain git clone directory in my arch linux laptop. Dependency only need to install npm and ttfautohint.

You don't need to download entire repo to build. This is how I git clone iosevka to build:
git clone -b master --single-branch --filter=blob:none -o iosevka https://github.com/be5invis/Iosevka.git iosevka
only 43.5 MB need to download (as version 15.2.0), and you have entire git log to peruse.

to build, create private-build-plans.toml containing your build script in iosevka directory, and run:
npm install
npm run build -- ttf::iosevka-custom

check dist directory for result.

To update Iosevka, just git pull, npm install, then rebuild using appropriate npm run build command.

@OnkelTem
Copy link
Author

OnkelTem commented May 4, 2022

You don't need to download entire repo to build. This is how I git clone iosevka to build:
git clone -b master --single-branch --filter=blob:none -o iosevka https://github.com/be5invis/Iosevka.git iosevka
only 43.5 MB need to download (as version 15.2.0), and you have entire git log to peruse.

Thanks @jamapy, I'll try!

It's worth adding into the README I believe.

@OnkelTem
Copy link
Author

OnkelTem commented May 4, 2022

Ok folks, I've finally found the reason.
It was indirectly the docker image fault, because it was hiding the problem I had with my build-plans file.
I pushed a PR which hopefully eliminates such problems.

As for the npm. After I had it fetched as @jamapy suggested, I could build my font immediately. Thanks.

@be5invis
Copy link
Owner

be5invis commented May 4, 2022

Feel free to submit PRs to update docs (and please target it to dev branch).

@OnkelTem
Copy link
Author

OnkelTem commented May 4, 2022

Sure @be5invis!

Are site sources here in the repo? I'd like to make a minor correction into the toml template, if no one objects :)

@be5invis
Copy link
Owner

be5invis commented May 5, 2022

@OnkelTem Site source is not there. Maybe I should add it later...

@ToxicSmurf
Copy link

ToxicSmurf commented May 7, 2022

@OnkelTem Can you please confirm, are there any errors with the docker image we should look out for, or was it just on your end?

@be5invis
Copy link
Owner

be5invis commented May 7, 2022

@ToxicSmurf At my side customization worked correctly. It looks like it is related with that Docker image.

@OnkelTem
Copy link
Author

OnkelTem commented May 8, 2022

@ToxicSmurf not really errors of the docker image, but it was masking error I had. Specifically, if you passed an option like ttf::my-super-build-of-iosevka, while having the build plans file missed (mistyped or whatever) it would not say you anything, silently ignoring the option. But hopefully now it's fixed.
In other respects it's just a wrapper around this npm.

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants