0

I have a production/test environment deployed on cloudcontrol that uses wkhtmltopdf in order to create a pdf from an html page. this html page may contains chinese characters though, and in this case once converted these characters simply disappear.

According to this question I should perform the installation of some fonts packages, but since I don't have a direct console access to Cloudcontrol this solution won't fit for me.

Before I escalate this request to the CC support team, did anyone had the same problem already?

bncc
  • 478
  • 7
  • 18
  • As with anything your app requires, you need to install it during the push, when the buildpack runs. This makes sure it is included in the image, the containers are started from. I'm not sure how and if this works with fonts, but it should get you started. Generally, fonts can be installed in userspace without root. So putting them into the image and then loading them before starting the app should work. – pst Aug 20 '15 at 13:41
  • Hello and thanks for the answer. I tried following the steps suggested in the link I attached and in particular by adding [this](https://github.com/lpuccini/CCTestBuildPack) repo to the buildpack, but could not manage to have the chinese characters. The `compile` file looks ok to me and I got no error when pushing. Any suggestion? – bncc Aug 21 '15 at 17:30
  • I'd use a run bash to see if this additional buildpack is really used. The usage instructions include changing the BUILDPACK_URL which isn't supported this way on cloudControl. If you really want to do this, you can request the change from support. But be aware, that this way, you are not using the maintained Buildpack anymore. Alternatively you can do the same steps in a custom script you call during push. Most package managers have a way to do so hooked to different events. – pst Aug 24 '15 at 09:08

1 Answers1

0

If anyone is interested, I fixed this issue by putting the 2 *.ttc files recommended in this post and extracted from the tar.gz retrieved here (microhei) and here (zenhei) into my git repository in a folder named .fonts/ and including this folder in Gruntfile.js in the same list of the other backend files under copy/dist/files.

Lat note, regarding zenhei I did not copy the .fonts.conf file as well but only the .ttc

bncc
  • 478
  • 7
  • 18