where the letter B (which could be at the beginning of a heading) is quite obviously not aligned with the text below. The large difference in font sizes exaggerates the space at the beginning of the line.
It seems to me that this is due how glyphs are layed out by the font itself, and none of the text(...) parameters change this issue.
Is there a way to visually align the first characters of each line, short of inserting hand-tuned negative spaces?
Hi! No — it’s not dropped capitals that I’m looking for. The example might have been stripped down a bit too much; the top line with larger font is a regular heading, which I trimmed down to just the first character.
Yeah, for Serif fonts, the behaviour makes more sense: They’re probably not visually aligned in the way that protrusion would allow at line endings when using justification, but the default is much better. (And I’m not sure that “protrusion” at the beginning of lines would be desirable.)
This has come up before, and I also don’t think that there is a solution except manually inserting negative spacing. Note also that this doesn’t only affect Typst, but instead seems to rather be a quirk of sans serif fonts in general, as it also happens with HTML.