Skip to main content
Jeffery.Wright
Inspiring
October 8, 2026
Question

HTML5 Canvas Adobe Fonts: Roboto not available?

Is there a bullet proof method to ensure the fonts I choose are visible to everyone? 
 

 Using Google web fonts let’s me see the Roboto font, as long as I look at the canvas from my computer. 
Other viewers only see the default serif font. 
Looks like I’m luck! 
or so I thought.

How do I get the font I want to use, to display for people who are not using my computer to browse my website?

 

My CSS file ensures all the text on my site uses Roboto:

 

@import url('https://googleapis.com');
*{
font-family: Roboto,Arial,sans-serif!important;
margin: 0;
padding: 0
}

 

The code on my canvas page only shows the font to me. 

<script>
function LoadGFonts(families, comp) {
var lib=comp.getLibrary();
var googleObject = {type: "Google", loadedFonts: 0, totalFonts: families.length, callOnLoad: lib.gfontAvailable};
for(var i =0; i < families.length; i++)
isFontAvailable(gFontsFamilies[i], googleObject);
}
function isFontAvailable(font, obj) {
var timeOut = 5000;
var delay = 200;
var interval = 0;
var timeElapsed = 0;
function checkFont() {
var node = document.createElement("span");
node.innerHTML = "giItT1WQy@!-/#";
node.style.position = "absolute";
node.style.left = "-1000px";
node.style.top = "-1000px";
node.style.fontSize = "300px";
node.style.fontFamily = "sans-serif";
node.style.fontVariant = "normal";
node.style.fontStyle = "normal";
node.style.fontWeight = "normal";
node.style.letterSpacing = "0";
document.body.appendChild(node);
var width = node.offsetWidth;
node.style.fontFamily = font+","+node.style.fontFamily;
var returnVal = false;
if((node && node.offsetWidth != width) || timeElapsed >=timeOut) {
obj.loadedFonts++;
if(interval)
clearInterval(interval);
obj.callOnLoad(font, obj.totalFonts);
returnVal = true;
}
if(node) {
node.parentNode.removeChild(node);
node = null;
}
timeElapsed += delay;
return returnVal;
}
if(!checkFont()) {
interval = setInterval(checkFont, delay);
}
}
</script>
<script>
var gFontsFamilies = ["Roboto"];
</script>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:900&subset=latin">


How do I get the text in my canvas to look the same to me, and everyone viewing it? 

Thanks. 
 

    4 replies

    kglad
    Community Expert
    Community Expert
    October 8, 2026

    system fonts are common to all users of that system.

    Translate
    Jeffery.Wright
    Inspiring
    October 8, 2026

    This process of using web fonts seems wildly inconsistent and unreliable, for example:

    Looks fine in my browser
    Viewing remotely = mixed results?
    Web font is selected, looks good live

    Web font is selected, but still displays as default serif, what gives?
     

    Same set up here, but will not display right? 

    My canvas page loads all the font styles:


    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:300&subset=latin">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:400&subset=latin">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:500&subset=latin">
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:900&subset=latin">

    But not all text fields are loading what they are configured to load, is anyone else running into this issue? 
     

    Translate
    kglad
    Community Expert
    Community Expert
    October 8, 2026

    you have to use system fonts if you don’t trust web-based ones.

    Translate
    Jeffery.Wright
    Inspiring
    October 8, 2026

    I can’t depend on all users having the same font installed, isn’t the point of using web fonts to ensure uniform style? Thanks. 

    Translate