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
|
||||
fontFamily, err := d2fonts.AddFont(font)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
var fontFamily d2fonts.FontFamily
|
||||
if !sketch {
|
||||
fontFamily, err = d2fonts.AddFont(font)
|
||||
if err != nil {
|
||||
ms.Log.Error.Printf("failed to load font %v, rendering with default font.", font)
|
||||
}
|
||||
}
|
||||
|
||||
ruler, err := textmeasure.NewRuler()
|
||||
|
|
|
|||
Loading…
Reference in a new issue