Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom font support #11

Open
jmernin opened this issue Apr 20, 2022 · 6 comments
Open

Custom font support #11

jmernin opened this issue Apr 20, 2022 · 6 comments

Comments

@jmernin
Copy link
Contributor

jmernin commented Apr 20, 2022

If your slide deck used custom fonts (e.g. Red Hat Display), which are not available inside the docker container, then the resulting video may contain incorrectly formatted slides. It may be worth exploring if there's any way to add the .ttf files for the fonts in question to the ARI ecosystem.

@jmernin
Copy link
Contributor Author

jmernin commented Apr 20, 2022

I wonder if we were to add the required .ttf files (which are available from https://github.com/RedHatOfficial/RedHatFont) into the /usr/share/fonts directory in the docker image, would that help?

@jmernin
Copy link
Contributor Author

jmernin commented Apr 20, 2022

So, good news. I manually copied some of the .ttf files downloaded from above into the /usr/share/fonts folder on the docker image and ran the "fc-cache -f -v" command to refresh the font cache (using guidance from this article: https://medium.com/source-words/how-to-manually-install-update-and-uninstall-fonts-on-linux-a8d09a3853b0).

I then regenerated my video once more and it looks like my text alignment issues are all fixed, so this looks like a viable solution!

@jmernin
Copy link
Contributor Author

jmernin commented Apr 21, 2022

Minor correction: I think we should place a copy of the .ttf files in a subfolder within /usr/share/fonts (e.g. /usr/share/fonts/redhat). I've tested this and it works and it's a little cleaner too.

@lucab85
Copy link
Owner

lucab85 commented Apr 25, 2022

Feature implemented by PR #18

@lucab85 lucab85 closed this as completed Apr 25, 2022
@jmernin
Copy link
Contributor Author

jmernin commented Apr 26, 2022

I tried out the latest image today and I'm afraid that the wrong set of .ttf files have been copied into it (and they've not been placed in a "redhat" subdirectory as recommended). They're also appearing with slightly odd-looking filenames (i.e. see the single quotes in the names):

# ls -l /usr/share/fonts/
total 536
-rw-r--r-- 1 root root 99976 Apr 25 13:15 'RedHatDisplayVF-Italic[wght].ttf'
-rw-r--r-- 1 root root 96656 Apr 25 13:15 'RedHatDisplayVF[wght].ttf'
-rw-r--r-- 1 root root 71928 Apr 25 13:15 'RedHatMonoVF-Italic[wght].ttf'
-rw-r--r-- 1 root root 66180 Apr 25 13:15 'RedHatMonoVF[wght].ttf'
-rw-r--r-- 1 root root 98836 Apr 25 13:15 'RedHatTextVF-Italic[wght].ttf'
-rw-r--r-- 1 root root 94232 Apr 25 13:15 'RedHatTextVF[wght].ttf'
drwxr-xr-x 3 root root  4096 Apr 25 12:53  truetype```

@lucab85 lucab85 reopened this Apr 27, 2022
@jmernin
Copy link
Contributor Author

jmernin commented Jun 24, 2022

While it's still fresh in my mind, here are the correct font files I believe are needed to ensure everything works here (assuming you've cloned/downloaded the full font repo from https://github.com/RedHatOfficial/RedHatFont):

$ mkdir avg/share/fonts
$ cp RedHatFont/fonts/proportional/static/ttf/*.ttf avg/share/fonts
$ cp RedHatFont/fonts/mono/static/ttf/*.ttf avg/share/fonts

In the case of the slide decks I've been using, I'm not sure the mono fonts are ever needed or used but there's certainly no harm in having them present anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants