SourceForge logo
SourceForge logo
Menu

Re: [matplotlib-devel] fonts pixelated in rotated text

From: Michael D. <md...@st...> - 2008年04月25日 19:13:00
I'm stumped. It looks like the code (and even the inputs to 
draw_text_image) are virtually identical, modulo the differences between 
Agg 2.3 and 2.4. Maybe the change is in Agg, and 2.4 is theoretically 
more correct? We can always experiment with different kernels and 
parameters until finding one that looks right.
Cheers,
Mike
John Hunter wrote:
> On Fri, Apr 25, 2008 at 1:08 PM, Michael Droettboom <md...@st...> wrote:
> 
>> They don't look non-antialiased to me (in your attachment or a file I
>> generated locally). Remember, the rotation happens in raster (not vector)
>> space, because that was the path of least resistance, but is a bit of a
>> hack.
>>
>> The difference is that the trunk appears slightly darker than 0.91.x. (And
>> 0.90.x, if I recall correctly, didn't support non-90 degree rotations of
>> text at all). 0.91.x is using spline36 interpolation, trunk is using
>> spline16. I *think* I changed it because I thought spline16 looked slightly
>> cleaner (though technically less accurate), and of course is faster, but I'm
>> not sure anymore -- SVN blame isn't helping me remember. It could have just
>> been the example I was using at the time looked better.
>>
>> In any case, you should be able to change this line in
>> _backend_agg.cpp:2197
>>
>> filter.calculate(agg::image_filter_spline16());
>>
>> to any of the interpolation kernels that Agg offers, and experiment until
>> you find something suitable.
>> 
>
> Hmm, I tried setting the interpolation back to what it is on the
> branch, but this doesn't explain it. If you run
>
> t = text(0.5, 0.5, 'hi mom', fontsize=20)
> t.set_rotation(30); draw()
>
> and save the results from the trunk and the branch (using
> agg::image_filter_spline36) on both, it appears (as you say) that the
> font weight is darker for rotated text, but not for non-rotated text.
>
> JDH
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

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 によって変換されたページ (->オリジナル) /