Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
my site is generating the error "Unable to generate a signwriter image with font at size Array" The error is rather cryptic -- it's hard to figure out what it means and what can be done to fix the problem. Perhaps it might be a good idea to make it easier to understand what that error means.
Everything works otherwise, and the images are properly generated. Thanks for your module!
Albert.
Comments
Comment #1
Agileware CreditAttribution: Agileware commentedThe error here is actually that it says Array instead of the size. It should actually say the font size. So if that is fixed your problem is solved.
I would imagine if you are seeing this error then it is possible that not all of your signwriter text is being displayed as a signwriter image.
Comment #2
maverick14 CreditAttribution: maverick14 commentedI have the same issue here.
Drupal says exactly: "# warning: imagettfbbox() [function.imagettfbbox]: Could not read font in /home/svn/drupal6/sites/all/modules/signwriter/signwriter.module on line 628.
# Unable to generate a signwriter image with font at size Array."
Any ideas?
Comment #3
Agileware CreditAttribution: Agileware commentedWhat are your font settings for the profile that is failing (primarily font-size value)?
If you don't know which profile it is give them all.
Comment #4
maverick14 CreditAttribution: maverick14 commentedI left the default font size to 20 for testing the module.
Comment #5
capellicI was getting that same error -- however the font sample (one font available) wasn't generating. I uploaded some other true type fonts and they worked fine -- so it was a problem with the actual TTF font file. Don't know why, but I thought I'd offer that a troubleshooting tip.
Comment #6
madiggo CreditAttribution: madiggo commentedI have the same error. In my case headers in Russian are OK, in English are errors. Take a look on header in Russian - http://oribern.ru/ru and on absence of header in English - http://oribern.ru/en. Same are for page titles.
Settings of site header:
Font - Heuristica Bold
Size - 24
Multiline on
Three state off
Shadow on
Transparency on
Border off
Max width - 700
Align - left
Image type - png
Comment #7
marcoka CreditAttribution: marcoka commentedi have the same issue, its because $image->fontfile[0] is 0 (NULL),
Comment #8
domidc CreditAttribution: domidc commentedSame problem here.
Solution is : download the font arial for example here (http://www.fontemple.com/free-download/612-Arial.html) and place it in the signwriter directory where you call the font name do it like this:
$profile->fontfile = drupal_get_path('module', 'signwriter'). '/Arial.TTF';
Why it doesnt detect a basic font like arial I dont know. I have this problem localy on windows7 and ubuntu. As on the server which runs Centos. The arial files are in fact present on all three Operating systems.
Comment #9
domidc CreditAttribution: domidc commentedMust of slipt to task. Sorry.
Comment #10
plato1123 CreditAttribution: plato1123 commentedAnother related question: Why is this error being shown to anonymous users on the front page??!!!
edit: In my case the error was being caused by a change my shared host made to the directory structure. I had used an absolute path for the fronts folder and fixed it by changing it to a relative path... ended up using: ../public_html/fonts
Comment #11
seren10pity CreditAttribution: seren10pity commentedYes, same issue here : Image fontfile[0] is null, but I noticed that it does that only for special caracters or accents.
I have set "All" in the Allowed non-ASCII characters field in profile config. So I get the error, but the image for the word, and the special character is well generated !
Don't know how to fix it...
Comment #12
dreizwo CreditAttribution: dreizwo commentedSame problem, but it only occurs when using a profile name with special characters or spaces. Try to use another (simple) profile name and, if you are using loading of profiles manually in your theme, ensure the
signwriter_load_profile('[name of profile]')
has exactly the same profile name.Comment #13
joelstein CreditAttribution: joelstein commentedNot sure why, but the solution in #12 seems to remove this error from appearing on my site (removing spaces from the profile names).