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

Italic-style look for upright font #1165

Closed
pv4 opened this issue Jul 23, 2021 · 4 comments
Closed

Italic-style look for upright font #1165

pv4 opened this issue Jul 23, 2021 · 4 comments

Comments

@pv4
Copy link

pv4 commented Jul 23, 2021

Is it possible to add an option/setting to get an italic-style look for upright font?

On the picture attached you can see how cyrillic would look like if such an option existed and was enabled. E.g. look at de having de.italic style applied as well as many other glyphs.

The variant attached was got by building with

[buildPlans.iosevka-some.slopes]
upright='italic'

and applying the sed before building:

sed -i "s/\.upright/.italic/g" font-src/glyphs/common/derivatives.*

image

@be5invis
Copy link
Owner

Merge into #599. This is about slope angle customization.

@pv4
Copy link
Author

pv4 commented Jul 23, 2021

This is about slope angle customization.

Not really. I don't want "Italic with a zero slope angle". I want "Regular with italic look AND zero slope angle".

I think I've found a better way than in the original post.

First, allow changing isItalic in private-build-plans.toml:

diff -Napur Iosevka-dev.orig/font-src/support/parameters.js Iosevka-dev/font-src/support/parameters.js
--- Iosevka-dev.orig/font-src/support/parameters.js     2021-07-17 08:50:52.000000000 +0300
+++ Iosevka-dev/font-src/support/parameters.js  2021-07-23 16:32:41.084191868 +0300
@@ -135,6 +135,9 @@ function createMetricDataSet(sink, mo) {
 function numericFieldHandler(sink, key, x) {
        if (x != null && isFinite(x)) sink[key] = x;
 }
+function booleanFieldHandler(sink, key, x) {
+       sink[key] = x;
+}
 function subObjectHandler(sink, key, obj) {
        sink[key] = {};
        createMetricDataSet(sink[key], obj);
@@ -154,5 +157,6 @@ const metricOverrideHandlers = {
        powerlineShiftX: numericFieldHandler,
        onumZeroHeightRatio: numericFieldHandler,
        multiplies: subObjectHandler,
-       adds: subObjectHandler
+       adds: subObjectHandler,
+       isItalic: booleanFieldHandler
 };

Then, use the following settings for build plan:

[buildPlans.iosevka-some.slopes]
upright='normal'

[buildPlans.iosevka-some.metric-override]
isItalic=true

Now iosevka-some-regular.ttf has the look I want.

Could you consider please making such a possibility supported? In #599 you wrote:

I think slope angles less than 10° should work, but not tested.

I guess zero is less than 10 so it "should work". But font-src/meta/naming.ptl has the following code that makes me think that using isItalic for Regular family is wrong and would behave badly in some environments.

set font.os2.fsSelection : accumulate : list
[...]
    list  Ot.Os2.FsSelection.ITALIC            (isItalic || isOblique)
    list  Ot.Os2.FsSelection.REGULAR           (!isBold && !isItalic && !isOblique)
[...]
set font.head.macStyle : accumulate : list
[...]
    list  Ot.Head.MacStyle.Italic     (isItalic || isOblique)

What do you think?

@be5invis
Copy link
Owner

With the new slope customization, you can do that. The result is like

[buildPlans.iosevka-custom.slopes.upright]
angle = 0
shape = "italic"
menu  = "upright"
css   = "normal"

@pv4
Copy link
Author

pv4 commented Jul 24, 2021

Thank you!

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

No branches or pull requests

2 participants