Label font size for Asymptote

244 views
Skip to first unread message

Sean Fitzpatrick

unread,
Jul 21, 2021, 12:18:24 PM7/21/21
to PreTeXt support
I've been noticing that some of the labels in Asymptote diagrams are smaller than I'd like.
The feature/challenge with Asymptote is that fonts do not scale as the diagram scales.

One result is that WebGL diagrams might appear differently on screens with different pixel densities. Documentation says the following:

Normally, WebGL files generated by Asymptote are dynamically remeshed to fit the browser window dimensions. However, the setting absolute=true can be used to force the image to be rendered at its designed size (accounting for multiple device pixels per css pixel).

I think using absolute=true could get us in trouble? If the designed size doesn't fit the canvas size provided by PreTeXt, the diagram isn't going to fit.

Does anyone have experience with getting fonts to look right?

Rob Beezer

unread,
Jul 21, 2021, 7:51:09 PM7/21/21
to pretext...@googlegroups.com
On 7/21/21 9:18 AM, Sean Fitzpatrick wrote:
> Does anyone have experience with getting fonts to look right?

Same behavior in TikZ, or close to it. I really didn't like it at first, and I
guess I still don't, but I've come to terms with it.

I wrote up a big thing for the documentation, really more advice or best
practice, which may still be on a branch (since it was not working exactly as I
expected!). The gist of it was: design your graphic with an eye towards its
intended use (meaning its size). In other words, don't make a graphic that
looks great standalone, and then gets scaled by a factor of 3 when set inside a
PreTeXt document.

The goal was to have the size of the fonts in a diagram look as much like size
of the fonts in surrounding text (be that LaTeX or HTML doing the font rendering).

Maybe not much help, other than a sympathetic ear.

Rob

Sean Fitzpatrick

unread,
Jul 21, 2021, 8:39:18 PM7/21/21
to pretext...@googlegroups.com
Thanks. I think this will require making a small document (for short compile time) and just doing trial and error until I like how it looks.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/2f4c1778-4465-3ed4-b375-5ddec6e8248a%40ups.edu.
Reply all
Reply to author
Forward
0 new messages