SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Michael D. <md...@st...> - 2007年07月10日 17:15:40
Has anyone looked into embedding fonts in SVG files? That might 
alleviate some of the installation problems that were recently mentioned 
on the matplotlib-users list.
The relevant spec:
http://www.w3.org/TR/SVG11/fonts.html
If there are no plans under way, I may have a crack at it, since I'm 
sort of on an "embedding fonts" kick lately anyway... ;)
Cheers,
Mike
From: John H. <jd...@gm...> - 2007年07月10日 17:34:36
On 7/10/07, Michael Droettboom <md...@st...> wrote:
> Has anyone looked into embedding fonts in SVG files? That might
> alleviate some of the installation problems that were recently mentioned
> on the matplotlib-users list.
>
> The relevant spec:
>
> http://www.w3.org/TR/SVG11/fonts.html
>
> If there are no plans under way, I may have a crack at it, since I'm
> sort of on an "embedding fonts" kick lately anyway... ;)
It's definitely come up before. Paul Barret may have had a look at
it. I'm not sure why we ended up not doing it. You can search the
archives if you are interested. If it isn't too hard, and major SVG
renderers support it, it seems like a great idea.
JDH
From: Michael D. <md...@st...> - 2007年07月10日 17:44:03
John Hunter wrote:
> On 7/10/07, Michael Droettboom <md...@st...> wrote:
>> Has anyone looked into embedding fonts in SVG files?
>
> It's definitely come up before. Paul Barret may have had a look at
> it. I'm not sure why we ended up not doing it. You can search the
> archives if you are interested. If it isn't too hard, and major SVG
> renderers support it, it seems like a great idea.
"major SVG renderers" support seems to be the issue at first glance. 
None of the big open source options -- Firefox, inkscape, rsvg -- seem 
to support it. Please let me know if I'm missing something. Firefox 
has even pushed SVG fonts off of the Firefox 3 timeline:
http://weblogs.mozillazine.org/tor/archives/2007/03/svg_priorities_in_firefox_3.html
Until there's something readily available to test with, there's probably 
not much point.
Cheers,
Mike
From: Carl W. <cw...@cw...> - 2007年07月10日 17:50:49
On 2007年7月10日 13:43:49 -0400, Michael Droettboom wrote:
> "major SVG renderers" support seems to be the issue at first glance.
> None of the big open source options -- Firefox, inkscape, rsvg -- seem
> to support it.
That's my understanding as well.
> Until there's something readily available to test with, there's probably
> not much point.
It's a classic chicken-and-egg. I know the cairo-svg maintainer is
hoping to add SVGFont stuff to cairo's SVG output to try to boostrap
past this problem.
-Carl
From: Michael D. <md...@st...> - 2007年07月10日 20:21:00
Actually, it just occurred to me that you could use 'defs' and 'use' to 
define characters as paths and reuse them. And that's something that 
works today in virtually any SVG renderer.
It totally blitzes the logical representation of the text (i.e. 
searching and copying as text etc.), but if it was only done for math 
text, then that's probably not a big deal. IMHO, math text is where 
matching the exact font is most important, where a reasonable substitute 
is often not installed, and where searching doesn't make a lot of 
sense. In any case, editing the SVG in something like Inkscape will be 
harder, since the text has become raw paths.
Thanks to ft2font, it was fairly easy to get outlines of math characters 
embedded in the SVG file. I've put up an example mathtext_demo.py SVG here:
 ftp://ftp.stsci.edu/tmp/mdroe/mathtext_demo.svg
I'll commit this code once it's cleaned up and better tested etc. if 
it's agreed this is something we want to do. I think in any case this 
should be optional -- it gives the file some portability at the expense 
of editability.
Cheers,
Mike
Carl Worth wrote:
> On 2007年7月10日 13:43:49 -0400, Michael Droettboom wrote:
> 
>> "major SVG renderers" support seems to be the issue at first glance.
>> None of the big open source options -- Firefox, inkscape, rsvg -- seem
>> to support it.
>> 
>
> That's my understanding as well.
>
> 
>> Until there's something readily available to test with, there's probably
>> not much point.
>> 
>
> It's a classic chicken-and-egg. I know the cairo-svg maintainer is
> hoping to add SVGFont stuff to cairo's SVG output to try to boostrap
> past this problem.
> 
From: Michael D. <md...@st...> - 2007年07月11日 14:33:05
I've tested this approach with Firefox 2.0 and rsvg 2.16. The text 
alignment is actually much better since the text layout is fully under 
the control of matplotlib. This has been checked into SVN, and can be 
used by setting the rcparam "svg.embed_char_paths" to True.
The following are my usual "size benchmarks" (that I used for PS and PDF 
as well):
without character paths -> with character paths
fonts_demo_kw.py: 10314 -> 69256
mathtext_demo.py: 10606 -> 37896
unicode_demo.py: 7677 -> 43473
over all demos in backend_driver.py: 17,722,815 -> 18,789,999
Cheers,
Mike
Michael Droettboom wrote:
> Actually, it just occurred to me that you could use 'defs' and 'use' to 
> define characters as paths and reuse them. And that's something that 
> works today in virtually any SVG renderer.
>
> It totally blitzes the logical representation of the text (i.e. 
> searching and copying as text etc.), but if it was only done for math 
> text, then that's probably not a big deal. IMHO, math text is where 
> matching the exact font is most important, where a reasonable substitute 
> is often not installed, and where searching doesn't make a lot of 
> sense. In any case, editing the SVG in something like Inkscape will be 
> harder, since the text has become raw paths.
>
> Thanks to ft2font, it was fairly easy to get outlines of math characters 
> embedded in the SVG file. I've put up an example mathtext_demo.py SVG here:
>
> ftp://ftp.stsci.edu/tmp/mdroe/mathtext_demo.svg
>
> I'll commit this code once it's cleaned up and better tested etc. if 
> it's agreed this is something we want to do. I think in any case this 
> should be optional -- it gives the file some portability at the expense 
> of editability.
>
> Cheers,
> Mike
>
> Carl Worth wrote:
> 
>> On 2007年7月10日 13:43:49 -0400, Michael Droettboom wrote:
>> 
>> 
>>> "major SVG renderers" support seems to be the issue at first glance.
>>> None of the big open source options -- Firefox, inkscape, rsvg -- seem
>>> to support it.
>>> 
>>> 
>> That's my understanding as well.
>>
>> 
>> 
>>> Until there's something readily available to test with, there's probably
>>> not much point.
>>> 
>>> 
>> It's a classic chicken-and-egg. I know the cairo-svg maintainer is
>> hoping to add SVGFont stuff to cairo's SVG output to try to boostrap
>> past this problem.
>> 
>> 
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
> 
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 によって変換されたページ (->オリジナル) /