Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73905

How to use other than default sans seriff family on HTML canvas?

$
0
0

is there any way to use other font-family in HTML canvas?

  ctx.fillStyle = '#FFF';
  ctx.font = '43px Arial';
  ctx.textAlign = 'center';
  ctx.fillText(name, 220, 515);

this is using Arial and it's work as it's in the sans seriff family. but i've tried by using other family and it's failed.

i've tried change Arial to Segoe-UI font like this:

ctx.font = '43px Segoe-UI';

but still no effect, how can i using segoe font on html canvas? if there's no way, is it a proper way if i save those text into image and import as image into the canvas?


Viewing all articles
Browse latest Browse all 73905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>