SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] mathtext baseline

From: Michael D. <md...@st...> - 2007年07月23日 12:02:11
I suspect my recent mathtext changes will help with Paul's problem.
I should probably give a quick update -- I've been coding pretty 
experimentally lately and didn't want to report on too much if I was 
likely to back it out later.
I've implemented a fairly direct Python translation of the TeX box 
layout model, which replaces the directional references used for layout 
in trunk. My main motivation was to help in the recursive layout of 
fractions (particularly in the vertical alignment) and the wandering 
baseline issue. Of course, this will only solve the baseline problem 
for mathtext (not other text), but I see the argument now for fixing 
that at a lower level. Both of these problems probably could have been 
solved within the existing framework, but I felt in the long run it 
would be useful to use the framework where so many math layout problems 
have already been solved. I'm still deciding whether to parse like TeX 
does (which uses two parsing phases and therefore makes some things a 
little easier/more efficient) or continue with the existing mpl parser. 
I suspect the existing mpl parser will result in more legible code at 
the expense of running some layout operations more times than strictly 
necessary. I'm not terribly concerned about performance -- TeX was 
designed for much weaker machines, and for much larger documents.
I expect to have the old parser up and running with the new box model in 
the next couple of days. It may be most expeditious to just wait for that.
Cheers,
Mike
John Hunter wrote:
> On 7/21/07, Paul Kienzle <pki...@ni...> wrote:
> 
>> Hi,
>>
>> I really love mathtext! I wrote a simple formula parser
>> and now I can label my graphs with easy to read chemical
>> names (I've attached it below for the curious).
>>
>> The problem is that the baseline is wandering. On my machine
>> the following has the 'h' too low and the 'io' too high:
>> 
>
> Just guessing, but...
>
> There is a problem we have with text alignment in the ft2font module.
> We can either align to top, bottom or center, but we need an option to
> align to the glyph baseline. Michael is currently working on mathtext
> and is now our resident font guru. Michael, can you take a look at
> this. This would be an important enhancement for mathtext, multiline
> text, and a text entry widget.
>
> Thanks,
> JDH
>
> 
>> import pylab
>> ax = pylab.subplot(111)
>> pylab.text(0.5,0.5,r'$\rm{Thiol}$', va='bottom')
>> pylab.show()
>>
>> I'm using wxAgg on OS X. I know I've installed freetype, but
>> beyond that I have no idea what font it is using.
>>
>> Do others experience the same problem?
>>
>> Any idea where I can start when debugging this?
>>
>> - Paul
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems? Stop.
>> Now Search log events and configuration files using AJAX and a browser.
>> Download your FREE copy of Splunk now >> http://get.splunk.com/
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>> 
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 

View entire thread

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /