It's a quest of mine to understand this subject mathematically. I'm convinced that typography is an exact science, it's just easier to use intuition than find the formulae that govern it. Like catching a baseball versus understanding gravity and drag. For example, when aligning that header, they're moving the leftmost pixels into alignment with the body's leftmost pixels. The correct state is well-defined, it's just…
I agree that typography could be an exact science, but I think starting with mathematics would be the wrong choice. Rather, it would be better to devise perceptual experiments and back fit a mathematical model to the results. The excellent LAB color space was created this way. Scientists used experiments - for example the MacAdam ellipse to measure what colors are distinguishable - then backfit a model to that. It in…
Regarding typography however, I argue that there are a multitude of concerns such as readability, aesthetic, and sustainence of focus. People will have different preferences and rankings for which concerns should be most optimized. Thus, the science of typography may need to be parameterized by the context of the text and what it is going to be used for.