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

Map slant axis for more accurate slant control #59

Closed
thundernixon opened this issue Jul 12, 2019 · 3 comments
Closed

Map slant axis for more accurate slant control #59

thundernixon opened this issue Jul 12, 2019 · 3 comments
Labels
aug-2020 Issues open as of August 2020 [for planning purposes] fixed in sources Issue is resolved in sources and is awaiting new build + release.

Comments

@thundernixon
Copy link
Collaborator

I'm not sure whether users need exact control over the degree of slant for Recursive. However, if they do, the slant axis will need an avar map.

fonttools/fonttools#1079 (comment)

Here's a script to generate that mapping:

https://gist.github.com/jenskutilek/f328f2ca250e8b9ebad0fb398a5a64c1

@thundernixon thundernixon changed the title Map italic axis for accurate slant control? Map slant axis for accurate slant control? Jul 22, 2019
@arrowtype arrowtype changed the title Map slant axis for accurate slant control? Test: map slant axis for accurate slant control? Apr 20, 2020
@arrowtype arrowtype added the aug-2020 Issues open as of August 2020 [for planning purposes] label Jan 8, 2021
@arrowtype
Copy link
Owner

arrowtype commented Jan 20, 2021

Two slight complexities of this:

  • The furthest Slant value is -15, but that corresponds to a real angle of most vertical paths at 14.04°
  • The cursive forms of glyphs are activated when slnt goes beyond -14.

So, the avar could do the following:

  • map values of 0 to -14 to real angles up to 14° (it could potentially go to 14.04°, but that might be pointlessly specific)
  • map values of -14.01 to -15 to -14.04

By default, Jens’s script prints out the following map:

            <map input="-14.000000" output="-14.000000" />
            <map input="-7.000000" output="-6.894468" />
            <map input="0.000000" output="0.000000" />

But for Recursive the required axis map is ... more complicated than expected. I need to map things to get closer to real angles, but I also have to make rvrn substitutions work beyond 14.04. Basically, I couldn’t just use the direct output of Jens’s script, because it (obviously) doesn’t take my (very) specific case into consideration.


In the end, I had to do a bit of guessing-and-checking, but I am quite happy with the results.

    <axis tag="slnt" name="Slant" minimum="-15" maximum="0" default="0">
      <labelname xml:lang="en">Slant</labelname>
      <map input="-15.000000" output="-15.000000" />
      <map input="-14.050000" output="-14.999999" />
      <map input="-14.040000" output="-14.980000" />
      <map input="-7.020000" output="-7.500000" />
      <map input="0.000000" output="0.000000" />
    </axis>

This is paired with condition sets like this:

<rule name="mono">
    <conditionset>
        <condition name="Monospace" minimum="0.500000" maximum="1" />
        <condition name="Slant" minimum="-14.985000" maximum="0" />
        <condition name="Cursive" minimum="0" maximum="0.900000" />
    </conditionset>
    <sub name="dotlessi" with="dotlessi.mono" />
    <sub name="f" with="f.mono" />
    <sub name="g" with="g.mono" />
    <!-- etc -->
</rule>
<rule name="mono autoitalic">
    <conditionset>
        <condition name="Monospace" minimum="0.500000" maximum="1" />
        <condition name="Slant" minimum="-15" maximum="-14.990000" />
        <condition name="Cursive" minimum="0.100000" maximum="1" />
    </conditionset>
    <sub name="a" with="a.italic" />
    <!-- etc -->
</rule>

Results

At -14.04 in Chrome (tested in Wakamai Fondue), the roman forms persist, but as soon as it goes past that, cursive/italic forms sub in:

image

image

Accuracy

At -15, the result is the same in slope and italic alts, because this is at the extreme of the axis in both cases:

image

At -14, it is about 1° more accurate, and allows for the full 14.04° oblique roman forms:

image

At -12, -7, and -5 it is a little more accurate:

image

image

image

And at 0, it is obviously just upright.

@arrowtype
Copy link
Owner

This issue is solved in the designspace updates of #435.

I will close this once I build those updates into a release. For now, here is the updated VF:

recursive-MONO_CASL_wght_slnt_ital--full_gsub-VF.ttf.zip

@arrowtype arrowtype added the fixed in sources Issue is resolved in sources and is awaiting new build + release. label Jan 20, 2021
@arrowtype arrowtype changed the title Test: map slant axis for accurate slant control? Map slant axis for more accurate slant control Jan 23, 2021
@arrowtype
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aug-2020 Issues open as of August 2020 [for planning purposes] fixed in sources Issue is resolved in sources and is awaiting new build + release.
Projects
None yet
Development

No branches or pull requests

2 participants