Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Fall-back fonts for JavaScript context.font

Is there any way I can have multiple fall-back fonts for JavaScript context.font?

a fall-back font is a font that the browser
'falls back' to if the current one isn't supported

For example:

ctx.font = '20px arial'
ctx.fillText('Hello World!', 100, 100)

Let's say that arial wasn't supported. How would I make the computer fall back to tahoma and then verdana?

I kind of understand how CSS works: font-family: arial, tahoma, verdana

... But does context.font do the same thing as CSS? Can I just write this: ctx.font = '20px arial, tahoma, verdana'? Or do I need to do something else for it to work?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!