Thank you for the reply, Ken.
Neither the main directory (or folder) nor any of the sub-directories contain spaces:
- the main directory where the XAMPP server software has been installed is 'E:\xampp\' |
- the main directory where the domain names are located is 'E:\htdocs\' |
- the sub-directory where the HTML/PHP scripts are located is 'E:\htdocs\tzweather' |
The arrangement/organization of the main directory and sub-directories has been the same for the past 10+ years without problem.
At one time in the past (might be days, might be week, might be months) the misbehaving PHP script was operating without error as it has been part of my experimental (under development) Web site.
I have already spent too many hours searching the Web for that stupid error...
Just for the fun of it, I downloaded a new copy of the XAMPP server software, install it without making any modification, moved some files within is 'htdocs' (ie: 'E:\xampp\htdocs\')(the directories and files needed by the PHP script) and run the script. The same error 'Could not find/open font...' was displayed!
I even tried to go back in time, I extracted XAMPP/PHP version 5.6.8 ... but could not get the server started...
After searching the Web for an additional two hours and trying different proposed suggestions, I have FINALLY found a solution to the 'imagettfbbox' function 'Could not find/open font...' error!!
Although the solution is simple, it was not that obvious: When using True Type Fonts with functions such as 'imagettftext or imagettfbbox' the '
canonicalized absolute pathname' must be use, the path to the font thus must be enclosed into the 'realpath()' function, such as, for an arial True Type font found in the 'font' root directory:
$TTFfile = realpath( ''../../fonts/arial.ttf'' );
OK, hopefully, this is the end of the 'Could not find/open font...' error...
Any way, I have been seriously thinking of stopping any Web development... As I have 'invested' in a WeatherFlow Smart Weather Station, I am now using a specific app (on both my tablet and my 'supposedly intelligent' phone) to get and display the data from my station. Obviously, I have also been spending a lot of time within the WeatherFlow Community/forums.
And there is this other venture where I am also spending a lot of time (more time than I have been spending within the weather-related forums): Home automation using all those neat IoT devices...