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 3237976
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:48:03+00:00 2026-05-17T17:48:03+00:00

I am working on a web application using SVG. The plan is to use

  • 0

I am working on a web application using SVG.

The plan is to use the Google Webfonts APIs to let the user choose their font type and then have their name rendered in SVG. The problem is that when I use the Google APIs to access the fonts, it does not work (reverts back to Serif font). However, when I download the Google fonts and then refer directly in my web application, it works…
Could someone please shed some light on how to get this working for the web applications.

Here is the code so far:

js.onclick=function()

    {
        var val=document.getElementById("txt").value
        var newText = svgDoc.createElementNS("http://www.w3.org/2000/svg","text");
        newText.setAttribute("id", "txxt")
        newText.setAttribute("x",275);
        newText.setAttribute("y",250);
        newText.setAttribute("font-size","50px");
        newText.setAttribute("fill","olive");
        newText.setAttribute("xlink:href",'http://fonts.googleapis.com/css?family=Josefin+Sans+Std+Light&subset=latin');
        newText.setAttribute("font-family",'JosefinSansStd-Light');
        var textNode = document.createTextNode(val);
        newText.appendChild(textNode);
        svgRoot.appendChild(newText)
}
  • 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-17T17:48:03+00:00Added an answer on May 17, 2026 at 5:48 pm

    Basically all what Google API’s do is same as @font-face in CSS but simplier to load fonts from different font providers. And CSS @font-face can be applied only on text.

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

Sidebar

Related Questions

We are building a web application using SVG & JS. The log file for
I'm working on a web application written in Java using the Tapestry 5.1.0.5 framework.
I'm working on one web application. I wanted to provide interactive debugging to my
I have just written a Word Document creation web application using .NET 3.5 which
I'm trying to write a web application using the new offline capabilities of HTML5.
I am working on web application. I wanted to apply auto height to textarea
I am working on one web application. I am interested in to fetch selected
I'm creating a WPF application, for which all users must be authenticated to an
I'm cleaning up a project to get rid of all the warnings, but I
Ok... so here's my actual status: Been a PHP Scripter for way too long,

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.