Skip to content

Output blank png image when use custom font family in windows #80

@lrh3321

Description

@lrh3321

Describe the bug

Output blank png image when use custom font family in windows

To Reproduce
Steps to reproduce the behavior:

  1. Execute freeze -x "echo Something" --font.family "Microsoft YaHei" -o freeze.png
  2. Execute explorer freeze.png

Expected behavior

Got an blank image.

Screenshots
If applicable, add screenshots to help explain your problem.
Snipaste_2024-04-17_20-49-36

Desktop (please complete the following information):

  • OS: Microsoft Windows
  • Browser chrome
  • Version 23H2 10.0.22635.3495

Additional context

Load the default fonts dir may help this

freeze/png.go

Lines 50 to 57 in 80803eb

err = fontdb.LoadFontData(font.JetBrainsMonoTTF)
if err != nil {
printErrorFatal("Unable to load font", err)
}
err = fontdb.LoadFontData(font.JetBrainsMonoNLTTF)
if err != nil {
printErrorFatal("Unable to load font", err)
}

fontdb.LoadFontsDir(OS_FONTS_DIR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions