zaffudo / CAH-Generator

Cards Against Humanity Card Generator
GNU General Public License v3.0
64 stars 29 forks source link

Generated cards text blank and centrally-aligned - 06-2022 #14

Open Jamnoggin opened 2 years ago

Jamnoggin commented 2 years ago

Generated cards text blank and centrally-aligned - Noticed 06-2022

Browsers tested Safari, Chrome MacOS (iMac).

iOS iPhone (Safari Screenshot 2022-07-02 at 09 14 23 )

jdahll commented 2 years ago

This seems to be caused by new security policies in ImageMagick.

I'm running this on a personal/internal webserver, so not sure of the implications of disabling the security on the Internet at wild.

Ubuntu20.04/Apache2/PHP/ImageMagick6

Edit /etc/ImageMagick-6/policy.xml

Towards the bottom comment out all the "<policy domain" lines that have rights="none".

jdahll commented 2 years ago

Problem I can't figure out now is how to get special symbols (such as registered trademark symbol ® ) to show up on cards. Right now they just come out having acted like that symbol doesn't exist. I suspect it's a matter of finding the correct "HelveticaNeueBold.ttf" file, but no leads on how to obtain the right one that will support this symbol.

jdahll commented 2 years ago

Had to set the System Locale on the OS via localctl for the registered trademark symbol to work.

apt -y install language-pack-en language-pack-en-base

localectl set-locale LANG=en_US.UTF-8

BLEEDINGBLACKROSE commented 2 years ago

i am having the same issue with no text being generated, has this issue been solved?

Jamnoggin commented 2 years ago

It wasn’t working for me after jdahll’s update.

I’m in the UK. Wondering if the regional settings make a difference with that font pack, assuming jdahll is in the US and it works in that location now.

Where are you based BLEEDINGBLACKROSE?

BLEEDINGBLACKROSE commented 2 years ago

I am from South Africa, doent render on PC or my phone

Narcissus04 commented 2 years ago

Hi, UK here - did this get sorted? Couldn't really follow the instructions to get it going

Jamnoggin commented 2 years ago

Hi, UK here - did this get sorted? Couldn't really follow the instructions to get it going

Hey no I tested it using ProtoVPN on a U.S. server but still did the same. 😕

kasekesy commented 2 years ago

doesnt work me either in canada.... super disappointed had a bunch of cards i wanted to make and it used to work flawlessly

Brinsky commented 2 years ago

jdahll is running their own copy of the server - the language pack details are for getting special characters to work correctly. Those details aren't related to the (seemingly broken) instance hosted on http://mywastedlife.com/CAH, so accessing the site from different locations won't help.

I spent some time getting a server of my own running on an Arch Linux machine. Here are my raw notes around the setup (I hadn't previously had Apache or PHP installed):

Original generator is http://mywastedlife.com/CAH/ (source code is https://github.com/zaffudo/CAH-Generator). At some point in 2022, it started returning blank cards - see https://github.com/zaffudo/CAH-Generator/issues/14.

On Arch Linux, install relevant packages:

Prepare the server and website (note - you will need to run most commands as root):

  • Make the httpuser the owner of the /srv/http directory: chown -R http:http /srv/http
  • Git clone'd https://github.com/zaffudo/CAH-Generator under /srv/http
  • Acquire HelveticaNeue font sources and place them in /srv/http/CAH-Generator/fonts/
    • The specific requirement is to have a file named HelveticaNeueBold.tff in that folder
  • Change CAH-Generator/blob/master/generator.php:110 to read mkdir($path, 0777, true); (seems like a PHP version/variant difference)
  • systemctl start httpd.service php-fpm.service (you could also do enable --now)
  • Can now accesshttp://localhost/CAH-Generator/index.html

Extra:

  • My fonts came with names of the form HelveticaNeue-Bold.ttf, so I installed/used the perl-rename package to rename them:
    • perl-rename 's/(HelveticaNeue)-?(\w+)\.(\w*)/$1$2\.$3/' /srv/http/CAH-Generator/fonts/*
  • tail -f /var/log/httpd/error_log was useful for debugging Apache/PHP errors

After that, I was able to successfully generate cards at http://localhost/CAH-Generator/index.html.

Brinsky commented 2 years ago

FYI, it seems like there is one fork whose author is hosting a public version: http://erftech.com/CAH (from https://github.com/DJalup/CAH-Generator). I haven't tried using it.

Jamnoggin commented 2 years ago

FYI, it seems like there is one fork whose author is hosting a public version: http://erftech.com/CAH (from https://github.com/DJalup/CAH-Generator). I haven't tried using it.

Oh neat I only just saw this update. Yes that host works, thank you so much!

The only difference in output comparing with other cards I've already exported from the OG site is the test height is about a millimetre higher up but it really won't be noticeable.

Now I just have to make the jump and order a test batch of custom printed cards!

addiekitten commented 3 months ago

This issue persists in 2024. Does anyone have or know of a functional fork/mirror? the efrtech appears to be completely gone.