otini discovers math typesetting 

These fraction rules are too thick; but which value am I to use? The math constants table of my math font (XITS) says 0.66, but 0.66 what? 😕

otini discovers math typesetting 

i can haz debuggin

Show thread

otini discovers math typesetting 

@otini Wow. That looks very similar to what I did. What did you base it on? I went through many iterations before I figured out some basics with respect to for example how a faction should be aligned with respect to the baseline.

Most of the time I was generating an expression using LaTeX and then checking how it's done there.

I even went to the source code of TeX to see how they did some things.

Is there some documentation somewhere?

otini discovers math typesetting 

@loke So this is all based on the work by Rui Xia at github.com/simoncozens/sile/pu, where he implemented the base typesetting algorithm as described by the TeXbook.

As for me, to style things I read chapters 16 to 18 in the TeXbook for general guidelines, and I use the “math constants” included in my math font. For instance, the height of the fraction rule relatively to the baseline (what Knuth calls “the axis”) is one of the constants.

otini discovers math typesetting 

@loke And I found documentation about OpenType math features, such as the constants table, there: docs.microsoft.com/en-us/typog
But it is not very satisfactory, as I complained in my initial toot.

otini discovers math typesetting 

@otini Wow. That's a lot of detail, and certainly not something I've paid attention to. 🙂 I've basically just picked measurements that seems to make sense, and the end result is OK, although not perfect by any definition.

otini discovers math typesetting 

@otini What is next for me is to try to somehow implement a line-breaking system for long expressions. I really don't know how to get started on that.

otini discovers math typesetting 

@loke The simplest way to do that would be to have predefined spots where a break can occur, e.g. before and after binary operators, and when a line is too long, break at the spot closest to the right edge.
TeX's algorithm is more complicated but produces justified text, which is probably not needed for math.

otini discovers math typesetting 

@otini I discovered that my formatting for sums and products isn't as good as yours. I'm not aligning the symbols correctly with respect to the baseline.

otini discovers math typesetting 

@loke Strange, this is something I didn't have to care about since it encoded in the font. What do you use to render the glyphs?

otini discovers math typesetting 

@otini
What is encoded in the font? The problem here is how the large sum symbol should be aligned relative to the baseline of the summed expression.

I think the solution is to align the centre of the sum symbol to the centre of the expression. The baseline of the whole thing would be the baseline of the summed expression.

I don't know how the font can help me with this calculation. It only gives me the measurements, yes?

otini discovers math typesetting 

@otini
Here's my code, if you're curious. github.com/lokedhs/maxima-clie

Do you have a repository for your implementation?

Follow

otini discovers math typesetting 

@loke github.com/OlivierNicole/sile/ is my current implementation of big operator rendering in Lua if you're interested. The output of the glyph itself is left to the text renderer, so the code is agnostic in the big operator glyph (called `base`). The base has three dimensions: width, height (height above baseline) and depth (height below baseline).

Sign in to participate in the conversation
Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!