be5invis / Iosevka

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

a slightly modified iosevka woes #606

Closed orlin closed 4 years ago

orlin commented 4 years ago

I really like this font, it reminds me of Pragmata or something, with such great configurability! Though I just want to customize a few things about the "design", maybe also turn on only a few ligatures for use in terminals with regards to vertical symmetry combinations. Once I get the hang of it, I'd probably use it everywhere... As a starter example, I imagine there must be a simple way to add the following line in some .toml:

design = ["v-tilde-low", "v-asterisk-low", "v-underscore-low", "v-at-fourfold", "v-zero-long-dotted", "v-brace-straight", "v-dollar-throughcap", "v-nine-turned-six", "v-eszet-longs-s-lig"]

I started out installing this old build and then wrote some bash scripts here to build my latest custom Iosevka with, install it, and restore in case things don't work out... Using a Ubuntu Linux with a Core i5 CPU a couple of generations old - it took so many attempts to get fed up with failure. Literally a whole day wasted, with only the scripts above and the design array to show for the time spent. These builds take quite a while and produce unusable results. The ttf fonts (all I need) get generated but don't install in any useful way. One example is getting a "?" for "@" which shows glaringly obvious in my system prompt, perhaps because part of the design modifications or not. Some versions are completely missing or unusable. Another odd thing is that the italic and oblique versions work fine, but I don't need those at all in this case. The wider-spaced "expanded' version works too. None of which I would use in a terminal.

How can I get just a normal upright font at regular or medium weight that's customized, plus a relatively bold version? Sorry to say but the docs feel lacking in that regard. Maybe because I never worked with toml before? It looks like an intuitive format that never gets any sensible results. Maybe my bin/ scripts have faulty assumptions - especially with regards to replacing a custom-iosevka? I also tried fc-cache -r instead of just -f and that makes no difference.


If you have problem when building Iosevka, please provide these information:

node utility/check-env Checking External Dependencies

be5invis commented 4 years ago

The build you picked up comes 3 years ago, and should before The TOML is introduced. That's really really outdated. Please grab the code from this repository.

To create your build, create a file named private-build-plans.toml with the following contents and put it directly into the repository's directory:

[buildPlans.iosevka-custom]
family = "Iosevka Custom"
design = ["v-tilde-low", "v-asterisk-low", "v-underscore-low", "v-at-fourfold",
          "v-zero-long-dotted", "v-brace-straight", "v-dollar-throughcap",
          "v-nine-turned-six", "v-eszet-longs-s-lig"]

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

[buildPlans.iosevka-custom.weights.bold]
shape = 700
menu  = 700
css   = 700

# You said you do not need italics. Remove this section when you need them.
[buildPlans.iosevka-custom.slants]
upright = "normal"

and then run npm run build -- contents::iosevka-custom.

Note that the style v-nine-turned-six have been renamed to v-nine-open-contour in dev branch, and will land into master at 3.2.

orlin commented 4 years ago

Thanks for the quick response. That very old font version build is simply what I am using at the moment and trying to replace with my iosevka-custom.

Yes, I have done similar mods so many times, and I just tried what you proposed. Unfortunately that's still no good. When I search for "Iosevka" with Xfce Terminal and this font installed with my scripts after having been built, I get:

Hnrduj` Btrsnl Ankc
Hnrduj` Btrsnl Qdftk`q
Hnrduj` Btrsnl Hs`khb
Iosevka Custom Bold Italic

This is the full list of possibilities and I'm glad it's a short one. Again, an italic stands out as usable. Everything else above isn't. If this Hnrduj and so on matches Iosevka it must have something to do with it or the issue?

be5invis commented 4 years ago

@orlin Could you please send me the files you generated as well as the private-build-plans.toml you are using?

orlin commented 4 years ago

The private-build-plans.toml with mostly edited-out comments:

[buildPlans.iosevka-custom]               # <iosevka-custom> is your plan name
family = "Iosevka Custom"                   # Font menu family name
# Customize styles
design = ["v-tilde-low", "v-asterisk-low", "v-underscore-low", "v-at-fourfold", "v-zero-long-dotted", "v-brace-straight", "v-dollar-throughcap", "v-nine-turned-six", "v-eszet-longs-s-lig"]
# upright = ["upright-styles"]            # Uncomment this line to set styles for upright only
# italic = ["italic-styles"]              # Uncomment this line to set styles for italic only
# oblique = ["oblique-styles"]            # Uncomment this line to set styles for oblique only
# hintParams = ["-a", "sss"]                # Optional custom parameters for ttfautohint

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

[buildPlans.iosevka-custom.weights.bold]
shape = 700
menu  = 700
css   = 700

[buildPlans.iosevka-custom.slants]
upright = "normal"
# italic = "italic"
# oblique = "oblique"

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

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

I'm not sure how to attach the build artefacts...

alexeyten commented 4 years ago

Have you restarted terminal after build? Letters usually mess up when you replace currently used font file with new one.

It’s also worth to run fc-cache after build

orlin commented 4 years ago

I have even restarted my system after build. Running fc-cache is part of my scripts. This is how that old font takes, and also the fully-built Iosevka works as it should by using the same scripts. Only what I build myself does not, so far...

be5invis commented 4 years ago
[buildPlans.iosevka-custom.widths.wanted]
shape = 5
menu  = 5
css   = "wanted"

This section is strange. You are defining another width that is same to the normal one, which may confuse the font manager.

be5invis commented 4 years ago

I'm not sure how to attach the build artefacts...

Just drag a zip containing the built fonts into the dialog box and it will be uploaded to GitHub.

orlin commented 4 years ago

Yeah, that looked weird to me too. Removed the [buildPlans.iosevka-custom.widths.wanted] and still same results.

be5invis commented 4 years ago

@orlin Then it may be an issue related with your font manager or shell... Could you please upload your TTFs so I could validate whether the fonts are valid?

orlin commented 4 years ago

ttf.zip

be5invis commented 4 years ago

@orlin The fonts you provided is valid. So it could be a problem of your font manager or terminal. Closed as external.

orlin commented 4 years ago

However allow me interject that I install your standard build font with the same scripts found in the bin/ directory of my fork (the $1 = "iosevka") , whereas the otherwise valid default iosevka-custom fonts from my dist/iosevka-custom do not in contrast install well at all. Something must differ in the way private-builds are handled...

Because this is the same script installing the same valid fonts from the same dir -- "iosevka" installs perfectly whereas "iosevka-custom" fails miserably. This contradiction made me start the issue.

orlin commented 4 years ago

I want to build and use Iosevka as you do, in cloud scenarios too -- drag-and-drop a valid ttf isn't always an option.

be5invis commented 4 years ago

@orlin The files you uploaded -- are completely valid, no issues. Which means, Iosevka's building system worked as expected. Considering you have built and installed your custom fonts multiple times before, and some broken versions may still in your computer, I suggest you to delete all your Iosevka-fonts (standard and custom), clean cache, and try to reinstall.

be5invis commented 4 years ago

I noticed one thing that the "old iosevka you referenced" is a term variant. you can try changing your design into this:

design = ["sp-fixed", "v-tilde-low", "v-asterisk-low", "v-underscore-low", "v-at-fourfold",
          "v-zero-long-dotted", "v-brace-straight", "v-dollar-throughcap", "v-nine-turned-six",
          "v-eszet-longs-s-lig"]

This will remove ligatures and all the wider characters so it could have better compatibility, especially with FontConfig.

be5invis commented 4 years ago

ERRATA: it is "sp-fixed" instead of "fixed".

be5invis commented 4 years ago

@orlin I can confirm that this configuration

[buildPlans.iosevka-custom]
family = "Iosevka Custom"
design = ["sp-fixed", "v-tilde-low", "v-asterisk-low", "v-underscore-low",
          "v-at-fourfold", "v-zero-long-dotted", "v-brace-straight",
          "v-dollar-throughcap", "v-nine-turned-six", "v-eszet-longs-s-lig"]

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

[buildPlans.iosevka-custom.weights.bold]
shape = 700
menu  = 700
css   = 700

[buildPlans.iosevka-custom.slants]
upright = "normal"

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

... could create a variant without any wider glyphs and should be recognized as monospace by FontConfig.

orlin commented 4 years ago

@be5invis I finally got it working, thank you for being so patient and helpful. Also thanks to @alexeyten for the suggestion to restart the terminal. Thought I had done that for sure! Exactly as described. I guess fonts get cached in the app and then mess up when replaced in the same iosevka-custom directory, and fc-cache can only fix the system cache.