Font selection order dependence #3893
KillTheMule
started this conversation in
General
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using typst as a library, and I've recently changed how my binary includes fonts (I don't use any system or dynamic fonts, only those included in the binary). I'm still using the exact same fonts and the exact same typst documents (however, the internal order of the fonts surely has changed).
Quick overview
Before, I included a font collection I made, and the binary would extract the fonts in a loop, create a `Vec` from this and then create a `FontBook` from that. Both were elements of a struct implementing `World` in the obvious way for fonts.Now, I include each font separately, and run
over its
data
to create the same as above.Note that the order of the fonts in the
Vec<Font>
and consequently theFontBook
has most probably changed (I can't be sure because I don't fully understand font collections).After the change, some spacing changed in my documents. It's not a real problem, but I'd like to understand where it's coming from.
One thing I noted is that in particular some empty lines (produced via
linebreak()
) did change their height, so one working theory I have is that the choice of font for parts of the document has been changed. Note however that the default test font should be an exact match.I have two questions:
Thanks for any pointers, if details are of interest I'd provide them for sure :)
Beta Was this translation helpful? Give feedback.
All reactions