I get no error or warning. In fact when I for example give a filename for the font which does not exist, I get an error on the Mac. On the windows computer I can put whatever I want in the fonts filename nothing happens. That means to me that it is not even coming that far on the computer.
I just did a test here using the example script from php.net and that works for me.
Wampserver 3.2.9 64bit, PHP 8.1.0 on Windows 10.
Before I copied the font to the folder I got an error in the browser, saying it could not display the image becaue it contains errors.
I had to comment out the PNG header to see the actual errors from Xdebug.
When I added the font, it was fine.
It’s Firefox which says it can’t display because of errors. In Chrome I just get a little square in the middle of the screen, same in Edge.
But as I say, removing the PNG header lets me see errors for Xdebug.
The error is about finding or opening the font. In the example script I’m testing the reference is simply:-
$font = 'arial.ttf';
So the font file is in the same folder as the script, which is where I copied it to.
Perhaps it is something to do with the file path.
This is what I see with the header removed.
For both there is no error or warning (even if I remove the content type like you did) but there is also no text. I tried to copy arial.ttf to the same directory too but no change.
What browser? That’s similar to what I saw in Chrome and Edge, except it was just a square, not as wide as that. Only Firefox showed the image error message.
Sorry I can’t shed any light on this. It’s a bit of a mystery.
I guess this is what they mean when people talk about inconsistencies when running PHP on different OSs.