Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2008, 06:36 AM   PM User | #1
bcatt
New Coder

 
Join Date: Mar 2008
Posts: 32
Thanks: 7
Thanked 0 Times in 0 Posts
bcatt is an unknown quantity at this point
How to reference external svg font?

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.
bcatt is offline   Reply With Quote
Old 10-05-2008, 11:28 PM   PM User | #2
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by bcatt View Post
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-20...GFontsOverview

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

best regards
oesxyl is offline   Reply With Quote
Old 10-07-2008, 05:24 AM   PM User | #3
bcatt
New Coder

 
Join Date: Mar 2008
Posts: 32
Thanks: 7
Thanked 0 Times in 0 Posts
bcatt is an unknown quantity at this point
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.

Last edited by bcatt; 10-07-2008 at 05:33 AM.. Reason: forgot to mention...
bcatt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:06 PM.


Advertisement
Log in to turn off these ads.