Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

Wait for font loaded in canvas

$
0
0

@Wijnand wrote:

I'm using a custom font defined by @font-face to draw text on a canvas:
context.font = "12px MyFont";
context.fillText(text, 20, 20);

Apparently the call to fillText is executed before the font is loaded, so it falls back to some standard font instead.

Some remedies are suggested in

  1. adding an extra element before the canvas doesn't work for me
  2. using a timer solves the problem, but that seems a ugly (and how long should one wait?)

Any suggestions on how to cope with this in Ionic (2)?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



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