Open beaugunderson opened 7 years ago
I should note I'm using the snap-specific version of 2.0.1 with the default theme and the default font (Andale mono).
After upgrading js-sequence-diagrams this also happens for me, for drawings with the simple
theme. The hand drawn theme is fine. I added this to the waitForFont
method to render immediately:
if(fontFamily != "danielbd") {
callback();
return;
}
Complete method:
waitForFont: function(callback) {
var fontFamily = this.font_['font-family'];
if (typeof WebFont == 'undefined') {
throw new Error('WebFont is required (https://github.com/typekit/webfontloader).');
}
if(fontFamily != "danielbd") {
callback();
return;
}
if (LOADED_FONTS[fontFamily]) {
// If already loaded, just return instantly.
callback();
return;
}
Thank you!
Noticed my diagrams were rendering very slowly. It appears that waitForFont takes time to load even if it's not doing any loading. I've just disabled it in my local version of the code but it might make sense to make it a configuration option if people don't want to incur the delay?