shrhdk / text-to-svg

Convert text to SVG path without native dependence.
Other
964 stars 131 forks source link

Random Errors when calling .load #26

Closed nearAP closed 6 years ago

nearAP commented 6 years ago

I have a call TextToSVG.load(fontPath, function(err, textToSVG) {}

The err function is randomly triggered. For example, I use the same font and it could work X times and then trigger the error the X + 1 time and work again if called the X + 2 time.

Any idea what could be wrong? Is there a gotcha somewhere or some specific but minor thing that must be done?

shrhdk commented 6 years ago

Hi @nearAP ,

load method retrieves the font data over the network. Whether it succeed or fail depends on network quality, server settings and any factors. Please try it with small file size font data or using CDN.

nearAP commented 6 years ago

Ok. Thanks.