dont fail on font load error
This commit is contained in:
parent
811a630fb7
commit
c01beb6089
1 changed files with 6 additions and 3 deletions
|
|
@ -282,9 +282,12 @@ func compile(ctx context.Context, ms *xmain.State, plugin d2plugin.Plugin, sketc
|
||||||
}
|
}
|
||||||
|
|
||||||
// load custom fonts before initializing ruler
|
// load custom fonts before initializing ruler
|
||||||
fontFamily, err := d2fonts.AddFont(font)
|
var fontFamily d2fonts.FontFamily
|
||||||
|
if !sketch {
|
||||||
|
fontFamily, err = d2fonts.AddFont(font)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false, err
|
ms.Log.Error.Printf("failed to load font %v, rendering with default font.", font)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ruler, err := textmeasure.NewRuler()
|
ruler, err := textmeasure.NewRuler()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue