Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change font in stem equations #1674

Closed
angelog0 opened this issue May 1, 2020 · 2 comments
Closed

How to change font in stem equations #1674

angelog0 opened this issue May 1, 2020 · 2 comments

Comments

@angelog0
Copy link

angelog0 commented May 1, 2020

I wrote a document that uses stem equations and that I compile both with ascidoctor (to produce an HTML file) and asciidoctor-pdf (to produce a PDF file). With asciidoctor-pdf I use the extension asciidoctor-mathematical and mathematical-format=svg.

Now in PDF output the font used for the equations is very poor. I am following this document. There is a section about the font in SVG images but I do not understand how to change the font for stem equations: it reports the example for font in diagram not in stem equations.

In the following archive there are two example, one from an HTM file and one from a PDF file, to proof tha bad quality font in PDF.

font_demo.tar.gz

I would be grateful if you can suggest also a good font for that.

TIA,
Angelo.

@mojavelinux
Copy link
Member

mojavelinux commented May 2, 2020

This has nothing to do with fonts. Asciidoctor Mathematical converts equations into SVG paths using mathematical (which uses the Math fonts at a low level, but what it makes are paths). Asciidoctor PDF then converts these paths into PDF objects using Prawn.

Right now, the height of the image cannot be controlled. It is preset by Asciidoctor Mathematical (based on a zoom level of 1). I always get a height 17px (which works out to 12.75pt) for a single line and 27px for multiple lines.

image:stem-44ecc32004b3425be206425da57c70cc.svg[width=114,height=17]

This one size fits causes problems if the base font size of your document doesn't match. Asciidoctor Mathematical needs to provide a way to customize the size, so please file an issue there.

As far as Asciidoctor PDF is concerned, this is a duplicate of this issue: #1483 (comment). The decision as to which size to use is made in Asciidoctor Mathematical, though as the issue suggests, we may provide hints back and forth to get it to fit better in the line.

@angelog0
Copy link
Author

angelog0 commented May 2, 2020

Thanks. I wrote #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants