justingardner / mgl

A suite of mex/m files for displaying psychophysics stimuli
http://justingardner.net/mgl
Other
18 stars 22 forks source link

Migrate text rendering from ATSUI to Core Text #91

Open benjamin-heasly opened 9 months ago

benjamin-heasly commented 9 months ago

MGL uses Apple'a ATSUI API for rendering text strings to glyphs in bitmaps. This API is deprecated, and as of macOS 14 Sonoma, no longer functional (release notes). Instead of rendering text, ATSUI API calls now raise a system error dialog and terminate the process!

Screenshot 2023-12-14 at 2 07 53 PM

It looks like the intended successor is Apple's Core Text API, according to this overview.

Maybe we should rewrite mglText to use Core Text, or migrate text rendering to the Metal app. In the meantime we can render text with a pure Matlab workaround called mglFigureText: 6d64d7ca7b24fb37e869d3f1e6e6ab5f7ac63513