Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    32
    Thanks
    7
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    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

  • #3
    New Coder
    Join Date
    Mar 2008
    Posts
    32
    Thanks
    7
    Thanked 0 Times in 0 Posts
    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 06:33 AM. Reason: forgot to mention...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •