...

View Full Version : How to reference external svg font?



bcatt
10-05-2008, 07:36 AM
I have converted a true type font to svg using batik, but am having trouble finding good resources on how to implement it. Can anyone tell me how to set the font for my svg text element to the external svg font file? Thanks in advance.

oesxyl
10-06-2008, 12:28 AM
I have converted a true type font to svg using batik, but am having trouble finding good resources on how to implement it. Can anyone tell me how to set the font for my svg text element to the external svg font file? Thanks in advance.
there is an example here( 3-rd):

http://www.w3.org/TR/2001/REC-SVG-20010904/fonts.html#SVGFontsOverview

I never use this therefor your feedback will be good form me, if I need :), and for others with same problem.

best regards

bcatt
10-07-2008, 06:24 AM
Thanks for the help. I had already read that, but I find the w3c documentation somewhat difficult to learn from and use it more after I've mostly figured the basics of a new language out.

Nonetheless, what I did discover is that all browsers are working hard on implementing native SVG support except (surprise, surprise!) Internet Explorer, for which a plugin must be installed before SVG can be delivered to the viewer (Adobe SVG Viewer seems to be the popular one, though they will not be updating it anymore because all browsers except IE are doing the smart thing with native support). However, even the browsers that are implementing native support are not quite there yet and many features do not yet work correctly, font elements being a primary unsupported feature.

I personally tried a few text/font related things out in the major browsers:
Safari is the only browser that handled the font related elements properly on it's own. IE works only if the plugin is installed (but when you include code in your page for downloading the Adobe SVG Viewer plugin, IE gives an ominous sounding warning about a potentially unsafe ActiveX control from an "unknown source", which is sure to discourage many from installing the plugin). Firefox and Opera neither have SVG plugins (that I can find anyway) nor support SVG font elements (yet), though they do support most other elements, and I can make "fake" text by changing the font information into shape information, though this results in more code, and it also requires a little tweaking.

Another interesting thing to note regarding SVG fonts: Firefox, Opera, and Safari all displayed the font I was trying to use when it was installed on my system (but I deleted it just to check, and Firefox and Opera no longer displayed it), so they can all interpret installed fonts through the SVG (still not entirely helpful, except on intranets) except (again!) IE, which tries to download the SVG file instead of reading and rendering it if the plugin is not installed.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum