Autospacing and autokerning are performed by the iKern’s core engine which can be seen, in the end, as a white space modeller. Harmonious separation of characters, that we can call Proximity, and constant reading flow, that we can call Rhythm, are two functions that co-exist in the white space dimension often showing conflicting requirements. To catch the inner nature of white space (and use it) it’s necessary to consider its peculiar feature: the non-coincidence between geometric space and optical space.
The proximity model expects the existence of a mechanism that tends to move closer far points and to move away near points. This way the white space can be seen like a medium endowed with not linear elasticity, distorted by the geometries of the letters’ outlines that, being constraints, act as boundary conditions. In case of autokerning we have two facing outlines. In case of autospacing the other outline is virtual and modeled as distortion opportunely imposed on the medium itself. From a conceptual point of view there’s little difference. The non-coincidence between geometric space and optical space, in this phase, firstly involves those portions of white space that are left embedded in the concavities of the outlines and become visually integrated to the outlines themselves. From the model’s point of view to assert that pieces of the white space don’t have the same weight is equivalent to say that portions of the outlines distort the medium with non-uniform effectiveness. We have to consider this effectiveness distribution as a further unknown of the equations.

Fitting with a "c", a letter with strong concavity that embeds part of the white space. 1) The fitting as produced by the engine for an "elastic bodiliness" value of 100% (it means: considering the internal white space as being part of the glyph). 2) The fitting as produced by the engine for an "elastic bodiliness" value of 0% (it means: considering the internal white space as not being part of the glyph).
We have just seen that the white space conforming to the shapes of the outines loses uniformity because is deformated following a non linear elasticity law. We can see this disuniformity as a variation in optical density. Where the outlines remain distant, so that the proximity interactions become weaker, the density decreases as long as the white space is not there to perform separation but filling. Then the white space behaves like air captured between the glyphs. The rhythm is then the mechanism balancing the optical density inside a pair with the optical densities of the single facing outlines allowing density exchanges as if this air could flow. Like a breath. The geography of distribution of low and high densities is simply and intuitively ruled: the exchange never happens from less to more dense regions.
That’s how compenetration varies depending on the shapes. Sometimes low density & large sized white spaces show a behaviour that we can call Bodiliness as the eye interprets portions of the resulting white region as belonging to the outlines that induced the disuniformity. High density & compact sized white spaces (those around stems and curved outlines), instead, are the beat of the rhythm. In fact, being the deformation the lowest possible, there’s nearly a correspondance between optical and geometric measure. The white spaces before and after a single glyph are also affected by the degree of asymmetry of the glyph itself. In fact we wish the consecutives white spaces to be the more similar as possible but asymmetric glyphs tend to prevent it. Asymmetry usually implies an air redistribuition and/or subtle changes in behaviour inside a range of acceptable solutions admitted by the model itself.

Pairs that show different “bodiliness” behaviours. The red number above the kerning value is the "bodiliness activation" whose range varies from 0 (minimum) to 1 (maximum).
To have introduced as unknown the disuniformities of the white space makes the system of equations indeterminate (that is: dynamic, because it has infinite equilibrium configurations). To make the best choice (that is: to solve the equations finding a locally stable configuration) we need additional conditions and these are found through total system energy minimization. In the end the non-coincidence between geometric and optical space appears like a necessary feature so that both the instances of proximity and rhythm could be satisfied for any combination of shapes and asymmetry. The generalization and the power of this approach, however, have a price: because of the inner dynamism, the definition of equations substantially depends on the mutual position of the outlines in such a way that it’s not possible to solve them analytically and directly. That’s why I had to implement a solving system by subsequent iterations that resulted unfortunately endowed with very slow convergence. And this means: goodbye to calculation in real-time.
Now some observations about the typographic consequences of this approach. The interactions are considered between any of the points by which the facing outlines are discretized. Therefore acting in any direction in the two-dimensional plan so that the vectorial resultant of all the interactions starting from a single point always assumes a preferential direction toward the facing outline that’s not generally horizontal: this is the foundation for the ability to process any kind of shape without the need of exceptions or particular cases to be treated in a differet way.

Sub Vertical Interactions.
Operatively
The first step to find the metrics using iKern is to input the proper parameters. We can see this process as tuning the engine.
STEP 1
The distance for which two points are not moved away nor closer is the average distance (simply called width). This value is the fundamental input parameter and lets you adjust the width of spacing. This parameter is not intended for adjusting the final spacing. There is a built-in post-processing tracking function for this. The width is the equivalent of the contrast in a picture (where the tracking is the lightness). The tighter spacing, the more proximity takes over. The looser the spacing, the less interaction there is between glyphs. In any of these directions the rhythm instance tends to be lost. The right choice is done by eye, of course, but also monitoring internal values that reveal the rhythm dynamics activating for key glyphs and pairs.
STEP 2
The measure of the rhythm, as seen above, is another fundamental parameter. The rhythm is mainly reconstructed finding new sidebearings and this process begins during the proximity phase, therefore in a way exclusively depending on the shapes of the outlines. To obtain a common rhythm we have to force the outlines, under certain limits and if necessary, to achieve side area values strictly dependent from common values (the side area is the area between the outline and the sidebearing). Although in iKern it’s possible to freely impose this measures I think it’s preferable to use the values deducted from the analysis to reach the minimum discrepancy between the proximity and rhythm instances so that the result will be aesthetically acceptable and the kerning values will be the lowest possible. This is an aspect of what I called “to follow the glyphs’ nature”. The kerning too is consequently affected when setting the rhythm. Let’s consider the WAH triplet, for example. The choice of the rhythm affects the H’s sidebearing and, considering that the kerning of AH will presumably be 0, then the WA pair has to be affected too.
The serifs seem to have the task to equalize the side areas of curved outlines and stems so there’s little difference between them and the natural rhythm is clear and evident. In a sans type the overall rhythm has to be decided by the curved glyphs alone because the stems now would have a too different side area. So they have to adapt themselves becoming wider than their intrinsic size inheriting some ghost air around. The amount of “ghost” air can be chosen as “stylistic” parameter.

Variable levels of "ghost" air around stems (in the middle the default output).
STEP 3
Since the mechanism we’ve seen above only affects high density white spaces the overall visual equilibrium needs to be compensated tuning the base stiffness of the non linear elastic medium in the proximity model that is, practically, a mechanism that acts in the opposite way. How much? This is a choice that is essentially done by eye really depending on design and rhythm.
Before processing the glyphs are rasterized to a resolution equal to ¼ of UPM Size (the minimum accuracy to achieve acceptable results) to obtain the left and right outlines. If necessary the outlines can be locally changed when there are unnecessary and “disturbing” components like, for example, the tails in some italic Q in Fell Types:
To make the system as general as possible iKern allows the detection of differentiated kerning zones for capital and small letters. A kerning zone is the range of y-coordinates of the white space where the actions related to autospacing and autokerning are considered active. These kerning zones may intersect at will, making the system ready for any kind of writing. The parameters are entered differentiated for different cases: small, capital and not letter. The width parameter, as exception, is also defined for the capital vs. small (and viceversa) case. And if necessary also quote and punctuation cases. The coexistence in the same font of characters of different styles and spacing (regular, small capitals, numbers, &c.) is allowed by Sets: it is possible to define different sets of parameters at need and assign a set property to each glyph. The kerning between glyphs belonging to different sets is done interpolating the parameters. Both for final class kerning and for minimizing the input process, every glyph is assigned of a motherhood property (that can be different for each side): any operation performed on a mother glyph is automatically inherited by the child glyphs. Each assignment is tested for superimposition and accepted inside a given tolerance.
A consideration
The calibration of the engine, its tuning, is a job only partially related to typographic choices in themselves and it’s hardly a creative process. It rather aims to find the right solution to a purely technical issue. That is: to stay as far away as possible from error.

