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

Calculate text size and descent correctly #4835

Merged
merged 1 commit into from
Jul 31, 2015

Conversation

mdehoon
Copy link
Contributor

@mdehoon mdehoon commented Jul 31, 2015

The calculation of text sizes and descent were always a bit off in the MacOSX backend. For example,

>>> plot([0,2],[1,1],'k--')
>>> text(0,1,'xxx',fontsize=50,verticalalignment='center')

will draw the xxx below the dashed line, instead of centered on it. It's hardly noticeable for common text sizes, but still it should be fixed.
This pull request fixes the text size & descent calculation, and makes sure that text appears in the correct location.

@@ -47,6 +47,7 @@
#ifndef COMPILING_FOR_10_5
static int ngc = 0; /* The number of graphics contexts in use */

#include <Carbon/Carbon.h>
Copy link
Member

Choose a reason for hiding this comment

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

Does this put a min OSX version constraint in? I don't follow mac at all, but have a vague notion that carbon is 'new'.

Copy link
Member

Choose a reason for hiding this comment

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

Carbon is the old api. Cocoa is the new one https://en.wikipedia.org/wiki/Carbon_(API) so I don't think so

@tacaswell
Copy link
Member

@tacaswell tacaswell added this to the next point release milestone Jul 31, 2015
tacaswell added a commit that referenced this pull request Jul 31, 2015
FIX: Calculate text size and descent correctly in osx backend
@tacaswell tacaswell merged commit c202749 into matplotlib:master Jul 31, 2015
@mdehoon mdehoon deleted the fixTextSizes branch July 31, 2015 15:45
@mdehoon
Copy link
Contributor Author

mdehoon commented Jul 31, 2015

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

Successfully merging this pull request may close these issues.

3 participants