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

Examples for Subscripts / Superscripts? #251

Open
hikaru150s opened this issue Apr 20, 2021 · 1 comment
Open

Examples for Subscripts / Superscripts? #251

hikaru150s opened this issue Apr 20, 2021 · 1 comment

Comments

@hikaru150s
Copy link

Is there any way to set portion of text to subscripts/superscripts?
If it's not implemented, could you tell me where it could be implemented?

Thanks

@rkusa
Copy link
Owner

rkusa commented Apr 22, 2021

This is not supported it pdfjs right now. I haven't looked in detail into how to make this happen, but I am aware of the Ts command in the PDF specification:

Set the text rise, Trise, to rise, which is a number expressed in unscaled text space
units. Initial value: 0.

This and/or font-size and baseline changes are probably the tools to make it happen. https://github.com/rkusa/pdfjs/blob/master/lib/text.js#L331 might be a good place to make adjustments for subscripts/superscripts text.

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

No branches or pull requests

2 participants