PEAR-Image_Canvas-0.3.1 expects its fonts to be placed in /usr/share/php/Image/Canvas/Fonts. The ebuild does not take any measures to install fonts at this location, although the needed font files can already be installed in /usr/share/fonts/corefonts by installing media-fonts/corefonts. Not having these fonts by default breaks at least one application (net-analyzer/centreon, unable to generate pie charts). Reproducible: Always Steps to Reproduce: Expected Results: The ebuild for PEAR-Image_Canvas should have the fonts installed automatically if available, or at least tell the user that fonts installation is needed. Attached is my quick and dirty fix to have the ebuild automatically symlink fonts from media-font/corefonts. I'm quite certain this is not the proper way to do it, so please let a portage guru create a proper fix.
Created attachment 150521 [details, diff] Example fix to create font symlinks at the appropriate location
If we already install the correct fonts somewhere else we need to tell PEAR-Image_Canvas where to find them. I'll have a look.
Actually, no, it doesn't expect its fonts in /usr/share/php/Image/Canvas/Fonts I had a look at the source and the order in which the font is tried is: IMAGE_CANVAS_SYSTEM_FONT_PATH (defaults to empty) dirname(__FILE__) . '/Fonts/' (the one you noted) GD lookup if it's a relative path So we can safely fall back to GD here, IF you have GDFONTPATH set. Which we don't have by default. You can try adding: putenv('GDFONTPATH=' . '/usr/share/fonts/corefonts'); If you only care about the windows fonts (needs media-fonts/corefonts) One Problem though: if you specify a windows font name like 'Courier New' and expect it to work - well, no, it won't. That seems to a bug. You can change Canvas/Tool.php Line 112 to say "$result = $filename;" so it won't set the filename to "Courier New" but "cour.ttf" instead. Without it, GD looks for "Courier/New.ttf", AFAIK (http://de2.php.net/manual/en/function.imagefttext.php)
Bottom line: the library works as advertised. It's the responsibility of the app using it to ensure a working GD setup. But i'll take the mentioned glitch in Tool.php upstream.