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

A string with a superscript char gets parsed into two strings #26

Open
ruinunes opened this issue May 31, 2017 · 3 comments
Open

A string with a superscript char gets parsed into two strings #26

ruinunes opened this issue May 31, 2017 · 3 comments

Comments

@ruinunes
Copy link

If a string contains a superscript char like , then the PDF::Inspector::Text.analyze(some_pdf).strings array will produce 2 strings:

m
²

instead of a single array entry with

@gettalong
Copy link
Member

This will depend on how to superscript was set: If it was set using the superscript character "²", then it should be in one string. However, normally superscript is produced manually by using a smaller font and offsetting the baseline. In the latter case two strings would be returned.

@ruinunes
Copy link
Author

ruinunes commented Jun 1, 2017

@gettalong

If it was set using the superscript character "²", then it should be in one string

Unlike what you are saying above, my case uses the superscript character to display a prawn document with the string - for denominating square meters -, using text 'm²'. This produces 2 strings in PDF::Inspector. The size of the strings array is 2. If you can double check, pls.

@pointlessone
Copy link
Member

Another option might be font fallback. If your current font doesn't have a glyph for supperscript character Prawn might switch to fallback font. Font switch produces another string in PDF.

Since we don't have reproducible example we can only guess.

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

No branches or pull requests

3 participants