View Single Post
Old 01-11-2022, 12:12 PM   #61
eriqjaffe
Hall Of Famer
 
eriqjaffe's Avatar
 
Join Date: May 2003
Location: Under The Christmas Fish
Posts: 7,636
Quote:
Originally Posted by wiggleman83 View Post
Some of the fonts seem to change when switching from plain to diaganol
Integrating custom fonts caused a lot of headaches with the diagonal text. I think it's fixed now.

For those who are interested, the reason only the diagonal text was affected was that there are two ways I am processing the text effects. Some of the effects are handled natively by the HTML canvas so those are easy-peasy. Some of them require a php script interfacing with ImageMagick running on the server - those are the ones that show the "spinner" animation when you use them.

In most of the ImageMagick cases, I send the "text" canvas element as an image to the php script (and, therefore to ImageMagick) which performs the transformation and sends the resulting image back to the page. The diagonal text works differently because I have to create it from scratch in ImageMagick. For that to work, ImageMagick needs to know which font to use and that's where things were breaking down; there is a key -> value array on the main page I was using to look up the font's path which I could pass to ImageMagick and a number of the keys weren't working due to the inconsistent naming I was using for the font families when I first created the app. Adding all the possible family name variations to the array seems to have fixed the issue without affecting anything else.

This doesn't affect the desktop version in the same way because I handle things a bit differently there - no php script, no problem.
__________________

Last edited by eriqjaffe; 01-11-2022 at 12:16 PM.
eriqjaffe is offline   Reply With Quote