Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4230528
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T01:52:31+00:00 2026-05-21T01:52:31+00:00

Is there a good library for converting SVG to HTML canvas that supports the

  • 0

Is there a good library for converting SVG to HTML canvas that supports the font element? I have already tried canvg, but it does not support Font.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T01:52:32+00:00Added an answer on May 21, 2026 at 1:52 am

    Browsers that support HTML5 Canvas also support SVG pretty well themselves. As such, you could do this:

    var img = new Image;
    img.onload = function(){ myCanvasContext.drawImage(img,0,0); };
    img.src = "foo.svg";
    

    The only downside to this technique is that if the SVG is outside of your domain the canvas will become tainted; you will not be able to use getImageData() to read the resulting SVG, if that is your goal.

    I’ve put an example of this technique on my server: http://phrogz.net/tmp/canvas_from_svg.html
    I’ve tested this and verified that it works (and looks the same) on IE9, Chrome v11b, Safari v5, and Firefox v4.

    [Edit] Note that:

    1. Chrome and Firefox currently ‘punt’ on security and disallow you from reading the canvas (e.g. getImageData() or toDataURL()) after you draw any SVG to the canvas (regardless of the domain) these have been fixed

    2. Firefox currently has a bug where it refuses to draw SVG to the canvas unless the SVG has height and width attributes specified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a good library that could determine the dimension of PDF pages? I
Is there a good library in c# that can check against a ftp and
Is there a good library (or wrapper to Java library) for graphs, and/or graph
Is there a well-known, portable, good library for C++ process management? I found a
is there a good and free PDF generator library for delphi ? I need
Is there a good tool that will look at a .NET assembly and tell
Is there any good way of truncating text with plain HTML and CSS, so
Is it good/safe/possible to use the tiny utfcpp library for converting everything I get
Is there a good library (preferably gem) for doing class checking of an object?
Is there any good library to implement facebook like comments and +1 system for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.