fix(font): use font base name

This commit is contained in:
Jan De Dobbeleer 2024-05-27 20:05:34 +02:00 committed by Jan De Dobbeleer
parent 85bfb55670
commit 517b7a6d57
2 changed files with 2 additions and 1 deletions

View file

@ -42,7 +42,7 @@ func InstallZIP(data []byte, user bool) ([]string, error) {
return families, err
}
fontData, err := newFont(zf.Name, data)
fontData, err := newFont(path.Base(zf.Name), data)
if err != nil {
continue
}

View file

@ -43,6 +43,7 @@ func install(font *Font, admin bool) error {
return fmt.Errorf("Unable to remove existing font file: %s", err.Error())
}
}
err := os.WriteFile(fullPath, font.Data, 0644)
if err != nil {
return fmt.Errorf("Unable to write font file: %s", err.Error())