Skip to content

msdfgen generates broken atlases for some fonts #293591

Description

@axeljaeger

brew config AND brew doctor output OR brew gist-logs <formula> link

brew config             
HOMEBREW_VERSION: 6.0.9
ORIGIN: https://github.com/Homebrew/brew
HEAD: 655769712a9a9499563d9685a8488f349354492d
Last commit: 9 days ago
Branch: stable
Core tap JSON: 13 Jul 09:03 UTC
Core cask tap JSON: 13 Jul 09:03 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DOWNLOAD_CONCURRENCY: 20
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_REQUIRE_TAP_TRUST: set
Homebrew Ruby: 4.0.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/4.0.5_1/bin/ruby
CPU: deca-core 64-bit arm_firestorm_icestorm
Clang: 21.0.0 build 2100
Git: 2.50.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 26.5.2-arm64
CLT: 26.6.0.0.1781586589
Xcode: 26.6
Metal Toolchain: N/A
Rosetta 2: false

brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libASAF.dylib
  /usr/local/lib/libndi.dylib

Warning: The following taps are not trusted:
  docker/tap
  jsontypedef/jsontypedef

Homebrew is currently ignoring formulae, casks and commands from these taps because tap trust is required.
Prefer trusting only the specific formulae, casks or commands you need.
Trust installed formulae from these taps with:
  brew trust --formula jsontypedef/jsontypedef/jtd-codegen
Trust installed casks from these taps with:
  brew trust --cask docker/tap/sbx
Trust other specific commands with:
  brew trust --command <user>/<tap>/<command>
Whole-tap trust is broader and includes all current and future formulae,
casks and commands from the listed taps. Trust whole taps with:
  brew trust docker/tap jsontypedef/jsontypedef
Untap them with:
  brew untap docker/tap jsontypedef/jsontypedef
To disable trust checks:
  export HOMEBREW_NO_REQUIRE_TAP_TRUST=1
This is not recommended and will be removed in a later release.
For more information, see:
  https://docs.brew.sh/Tap-Trust

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.
  • My issue is not about a failure to build a formula from source.

What were you trying to do (and why)?

I tried creating a Multi-Channel-Signed-Distance-Field (MSDF) Font from Google Fonts (inter and roboto). I wanted to use this font for a 3D application where SDF and MSDF fonts are a common technique.

What I found out already: The version of msdfgen that was recently added by @lczyk (thank you) is not compiled with skia support. This seems on purpose, I mostly want to point some problem with it and start a discussion how to move on from here.

What happened (include all command output)?

The generated font includes some artifacts. Note the t-junction.

Image Image

What did you expect to happen?

A font atlas without the artifacts: (Generated using another piece of software).

Image Image

Step-by-step reproduction instructions (by running brew commands)

brew install msdfgen
msdf-atlas-gen \
  -font "inter.ttf" -chars "'e'" \
  -type sdf -size 256 -pxrange 16 -dimensions 320 320 -yorigin top \
  -imageout assets/homebrew-sdf-atlas-gen-e.png

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions