SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Jae-Joon L. <lee...@gm...> - 2008年12月18日 23:34:08
This post is related with a bug reported in
http://sourceforge.net/tracker/index.php?func=detail&aid=2430751&group_id=80706&atid=560720
John assigned this to me, and I thought it is better to discuss with others.
First of all, I actually don't know much about the svg, so others
(someone who wrote the svg backend?) may give much better answer than
me.
Anyhow, I guess there are two issues related.
1) As Jacob said, all the text in MPL is actually left-aligned. MPL
internally calculates the needed offset according to the alignment,
and make all the text left-aligned.
2) The resulting texts have wrong alignment If svg renderer picks up
different font than what MPL used to calculate the offset. This does
not happen if embed_char_paths=True.
I'm not sure whether we need to concern about the first issue. We may
delegate alignment of text to svg renderer as Jacob suggested. This
may be useful when one wants to edit the output svg file using tools
like inkscape. MPL still need to calculate the offset due to different
alignment to support things like (fancy)box around the text. I'm
personally happy with the way it is, though.
The second issue may need some work. The best way I can think of is to
embed the font inside the svg file (but this has a license issue,
although we're doing it now anyway). As of now, when embed_char_paths
is True, the glyphs of each character are embedded as paths, not as a
font. It will be relatively easy to change the current code to make
the embed path as a font, although handling of kerning and such will
be quite difficult. We may include svg font with kerning information
in the mpl distribution (as we do for some ttf and other fonts now)
and embed these fonts to the ouput file.
I guess, it all depends on how strongly we want to support the
post-editing of the output svg file.
So, how others think?
Regards,
-JJ
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 によって変換されたページ (->オリジナル) /