RMX Scaler works for one master, distorts another

I have a .glyphs file whose masters were originally imported from very old TTF files and not drawn in Glyphs. It’s a (large) old font that I’m working on extending. There are only two masters: regular italic and bold italic.

I’m adding small caps. The font already has quite a few [letter]small glyphs that I can reuse, but there’s a handful missing, which I’m generating with RMX Scaler. I’m generating them individually for each glyph. Before generating, I have made sure that:

  • Both masters have vertical and horizontal stem values set (one for uppercase, one for lowercase; I don’t know if it makes a difference, but they’re listed in the order Vertical Upper, Vertical Lower, Horizontal Upper, Horizontal Lower in Font InfoMasters)
  • The masters have different weight values, set to the same weight as the lowercase vertical stem size (153 for the regular, 255 for the bold)
  • The glyphs that I’m scaling are compatible for interpolation (same number of nodes, same shape order, same first node and path direction, no red line showing incompatibilities), and animating the interpolation in Variable Font Viewer works as expected
  • There are no overlapping handles

When I run RMX Scaler to generate small caps versions, the regular master works perfectly – it scales the glyph down and maintains optical weight. For the bold master, however, it completely distorts the glyph, creating some very odd shapes in the process.

For example, this is the Thorn glyph in master compatibility view from bold to regular:

These are the RMX Scaler settings used to generate the small caps:

This is the result in the regular master (where it works):

And this is the result in the bold master (eek!):

I’ve done this with five or six different glyphs now, and the result is the same every time: regular master works perfectly, bold master is distorted.

This is on Glyphs 3 (3324) on Sonoma (14.7.1).

Since the glyphs in both masters are compatible and interpolation between them works, I’m kind of at a loss as to what may be the root cause of the scaling only working for one of them. Where should I be looking for a culprit to fix this?

(@TimAhrens)

Try:

  • cleaning up paths a bit more. Pretty sure the ‘diagonal nodes’ are not necessary and cause kinks in interpolation. Toshi has a script for deleting diagonal nodes.
  • Reintroducing overlaps. Select the two nodes at the stem connection, hold down Opt and choose Reconnect Nodes in all Masters from the context menu.
  • Avoiding super short segments like the multiple segments for representing just on curve in the serifs.

All these things cause issues in interpolation, rendering, and give RMX Tools a hard time.

What Rainer says. The results you are showing look as to be expected based on your two masters. I would recommend cleaning up almost horizontal line segments, which you can highlight with the Show Angled Handles plugin.

Getting rid of some nodes and making sure all handles are either at 0°, 90° or 16.333° (the slant of the italic) definitely helped – most of the kinks are now gone, though the bowl is still too narrow and the vertical stem too wide:

Scaled regular:

Scaled bold:

What I don’t understand is, if the number and position of the nodes was the problem, then why did it consistently only affect the bold master (especially when interpolation worked just fine in Variable Font Preview)? Why was the regular not affected?

Which two nodes do you mean exactly? Which part is the ‘stem connection’ (which stem, and connection to what)?

Reintroduce overlaps like this:

Use “Open Corner” to extend the curve segments into the stem and then rewire them with Reconnect Nodes.

Remember you are not doing an interpolation, but an extrapolation. So just because the interpolation looks good in VFP, that doesn’t mean the extrapolation will look just as good. Note how, in your source glyph Thorn, the bowl is much narrower in your bolder master than in your lighter master. This relation will be even more accentuated in your extrapolation. Issues like this very often indicate problems in your original designs, which are maybe not as apparent, but stick out far more when extrapolated.

Well, yes, the bowl is narrower in the bold – that’s a fairly inherent part of bolder weights. I won’t pretend to understand maths well enough to know why that will be more accentuated in extrapolation (or indeed how extrapolation differs from interpolation under the hood).

Splitting up the glyph into two overlapping shapes helped a little bit, but each scaled-down shape in the bold master still ends up with a stem that’s either the same width or even slightly wider than the one in the full-size glyph. The description says RMX Scaler uses the stem widths in the fonts, but what does it use them for, exactly, when the resulting shapes have stems outside the font’s stem range?

To show a very simple example, this is how I ends up in the bold master (temporarily put next to the uppercase source) – the stem in the uppercase glyph is 302 units, the one in the scaled glyph 314 units (the uppercase stem set for the master is 297):

I would maybe suggest doing this scaling (or, more precisely, anisotropic interpolation) manually, in order to understand the mathematics behind the transformation RMX is doing for you.

Tim Ahrens’ article on his RMX tools explains the principles used: https://remix-tools.com/pdf/Tim_Ahrens_MM_method.pdf

Doing this manually will help you understand why the things that are happening in your setup are happening.

I don’t think that’s going to happen, unfortunately. Three pages into Tim’s article, and I’m already thoroughly and utterly lost. I haven’t done maths since elementary school, and that was a good while ago!

Sorry, bit late to the party. I have been working on RMX a lot over the last few weeks, making it more robust, and avoiding weird behaviour in corner cases. Would you mind sending me the file? The problem may be fixed already, or I can have a look at it. The aim is that the RMX tools always produce sensible results even with quirky set-ups. Thanks!

Sent – thank you!

Thanks for the file. The example with the Þ above is not included any more but I can guess what is going wrong:

  • Some of the contours are formally compatible, i.e. the masters have the same number and type of points, but the relation between them is very different. See the video: The right diagonal on-curve point is rather close to its upper neighbour in the regular italic, and very close to the lower neighbour in the bold italic. While interpolation and extrapolation is technically possible, the results are poor. In particular, extrapolation will move the diagonal node below the extremum. Even the interpolation does not result in the shape you would want because the diagonal node “cuts across”.
  • Scaling down the bold glyphs always implies extrapolation. This is why the reduced-size bold shows the flaws whereas the regular is roughly what you would expect.
  • The first image you posted suggests that the bold Þ has a sloped straight near the second starting node while in the regular it seems to be horizontal and shorter in relation to the width of the counter. As a result, these differences are exaggerated in the small bold Þ, with a steeper, proportionally long straight.

In order to generate acceptable bold small caps, the solution would be to ensure the node structure, as well as the design characteristics, are compatible in a quantitive sense, not just the point types. To improve the generated bold small caps, you can also consider adding an “intermediate”, i.e. brace layer that is heavier than the bold to the source glyphs. Don’t forget to re-interpolate (actually, extrapolate) this layer. This will reveal inconsistencies between the two masters, which you can tidy up (and then even re-interpolate the bold if you want).

1 Like