freetype: need to support png support for some emoji font #466
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#466
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm still using my own freetype zig fork for now and haven't had time to contribute (sorry!) but I ran into this and I think you will too. Some Emoji fonts such as Noto (Google) use embedded pngs which require freetype to be built with png support.
This is a bit of a can of worms so I'll explain it all here so you can avoid the footguns:
libpngzlibFT_CONFIG_OPTION_SYSTEM_ZLIB=1for freetype and link in zlib that you used for step 2.libpng and zlib are both easy to build with Zig.
To test it all works, you'll need to load a glyph from a png font, Noto works well.
Embedded PNGs in fonts! I had no idea, that's nasty :/ I agree we should fix this in the freetype bindings as you suggest.
In Mach itself, we're hoping to render glyphs ourselves on the GPU using freetype just to extract beziers - I was hoping we could use Noto too but I guess we'll need to find a fallback approach for whichever glyphs only have pre-rendered PNGs. Crazy.
Yeah Noto not only uses embedded PNGs, but they're fixed at a single resolution. Right now I'm putting them at full resolution into a texture atlas and downsampling in a shader, but I might move to downsampling a bit on the CPU since its a bit wasteful how large they are.
https://github.com/adobe-fonts/noto-emoji-svg looks interesting?
Maybe! I haven’t used SVG fonts yet, I’ve only read about them in the FT docs. I know that FT doesn’t include any SVG renderer but you can get the SVG data and probably pass that into a shader. Might be easier to just rasterize the SVG on CPU and then put that in a texture though.