The Metal path creates a GLFW window with GLFW_NO_API (no GL
context), but demo_font_upload_palette() unconditionally called
glGetIntegerv(), causing a segfault on the first glyph lookup.
Split palette upload into GL and external-backend paths:
- Extract demo_font_get_palette() to read CPAL colors into a
float array, shared by both paths.
- GL path (demo_font_upload_palette_gl) uploads via glUniform4fv
as before.
- External-backend path uploads via a new upload_palette callback
in demo_atlas_backend_t.
- Metal renderer implements the callback, writing palette data
directly to its paletteBuffer.
This fixes the --metal crash and enables proper COLRv0 palette
color rendering on Metal.
Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>