#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Reason not to simplify caretSlopeRise and caretSlopeRun ratio for Italic? Rise 1000, Run (Even #)

Posts: 98
Among other things, I started to look into the data that goes into making an italic. In trying to find out what the aforementioned values in hhea meant I came across Apple’s manual noting:
Note that since the slope is a ratio, values may be used which simplify or speed up calculations. A `caretSlopeRise` of 8 and `caretSlopeRun` of 6 means the same thing as `caretSlopeRise` of 4 and `caretSlopeRun` of 3.
I also found Adam Twardoch’s comment about “rational angles,” which used simplified values.
However, as I looked into some italics from fonts I have (Harriet Text, Quadraat, Akko, and others) each had a caretSlopeRise of 1000 units and varied in the caretSlopeRun. Some could not be simplified, but others certainly could be. I figured it had something to do with the bounding box, but that doesn’t make sense considering a vertical font’s values would be the simplified Rise 1, Run 0.
Tagged:

• Posts: 1,747
I've been advocating integer-ratio slopes since 2001.

• Posts: 66
In a metrics run over 1900 Open Source fonts I have, many have Rise=1000 with variable (and appropriate) Run settings. Some fix Rise=100 and some fix Rise=2048.

On my fonts, I (for some reason) decided to keep the numbers small and have an 8-way case statement that uses different scales based on ranges of tan(90-italicAngle). The ranges are set so that the results is within half a degree for all integer values of italicAngle (I keep my italicAngle integers).

I am guessing that the only practical use for the caretSlopeRise/Run values are when drawing the shape of a selection range ... is that correct? If so, I am thinking that finicky precision in setting these is not really needed ... plus or minus half a degree should be OK, yes??
• Posts: 98
Hrant, hmm, I’ll experiment some with that to see if I’m understanding it correctly.
Clint, interesting, though I’m certainly not well-versed enough to give clarification on you final question there .
• Posts: 1,747
Basically points are on the grid (which degrees go against) so slant is best expressed as an integer number of units in one dimension corresponding to an integer number in the other dimension. If I have a diagonal line that's slanted 1:5, for every unit I move a point on the line to the right, I simply then move it 5 units higher, and the line stays exactly the same inclination.
• Posts: 98
Ah so it is as simple as it seemed, for some reason I made it more complex in my head! I feel I was too shallow in my responses, so I’ll expand a little.
Hrant, so the slope becomes a technique of three things: the italic angle value, the caretSlopeRise and caretSlopeRun simplified to their smallest values, plus your addition of adding the points themselves by that ratio when there it curvature involved. I imagine one wouldn’t put all the points in a situation where it is straight though, no?
Clint, how does one perform a metrics run? I'’m not entirely sure I understand what you mean about the case statement scale, so I’m going to try and say what I think you’re saying, correct me if I miss the mark! You have set up eight ranges of italicAngle a font can use in case a curved slope needs to be adjusted to a different angle to appear uniform along itself. You then have a series of ratios close to the original to fall back on. I feel like I’m wrong there.
As for precision, well if one can be precise I don’t suppose there’s a reason not to be. Think of it as future-proofing the font: it seems unlikely, but if the way the metadata handles these particular values were to change the way the font is displayed then you’ve got a one-up over designers who didn’t take precise precautions. As I said, though, I am not well-versed enough to give a sure answer there.
Going back to the 1000 rise though, I’m just curious why a designer (I’ll use a made up Run here just for the example’s sake) wouldn’t simplify say Rise 1000, Run 500 to Rise 1, Run 5 as it is the same thing, and Apple at least says it would speed up calculations, however micro the time saved may be. Using the Didot I’m working with as another example, it has an angle of 18°, which would be Rise 1000, Run 325, but I would simplify it to be Rise 40, Run 13. Unless there is a reason not to…
• Posts: 1,932
ClintGoss said:

I am guessing that the only practical use for the caretSlopeRise/Run values are when drawing the shape of a selection range ... is that correct? If so, I am thinking that finicky precision in setting these is not really needed ... plus or minus half a degree should be OK, yes??
It tells the OS what angle the caret (text insertion point) should be drawn at.

Maybe it has some other use, but yes, within half a degree should be more than enough accuracy for this purpose.