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

Interpret font Descent as a negative number even if specified as positive #203

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

jbarlow83
Copy link
Contributor

The PDF RM specifies that Descent should be negative. Fonts that claim
to have a positive Descent (not that it would make sense) always seem
to be wrong about this claim.

The PDF RM specifies that Descent should be negative. Fonts that claim
to have a positive Descent (not that it would make sense) always seem
to be wrong about this claim.
@jbarlow83 jbarlow83 changed the title Interpet font Descent as a negative number even if specified as positive Interpret font Descent as a negative number even if specified as positive Nov 4, 2018
@tataganesh tataganesh changed the base branch from master to develop November 8, 2018 18:54
Copy link
Member

@pietermarsman pietermarsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbarlow83, it has been a while since you've posted this PR, do you have time to some super small cosmetic changes?

I think it is a neat improvement.

And indeed, the pdf reference manual is clear that it should be below zero:

(Required, except for Type 3 fonts) The maximum depth below the baseline reached by glyphs in this font. The value is a negative number.

# PScript5.dll seems to produce Descent with a positive number, but
# text analysis will be wrong if this is taken as correct. So force
# descent to negative.
if self.descent > 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you group all the code for self.descent? 11 lines above the numeric value is parsed and the additional logic is here.

@pietermarsman
Copy link
Member

@jbarlow83, do you have time for some tiny changes?

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

Successfully merging this pull request may close these issues.

2 participants