Plex Server not picking up system wide fonts on Linux

Server Version#: 1.18.4.2171
Player Version#: Plex Web 4.20.1 / Current Roku App

I have a number of files with styled subtitles, and sometimes when it transcodes it seems to be falling back to some default fonts. I recently migrated my Plex Server from Mac to Linux, and on the Mac it would pick up fonts installed in standard system wide locations. On Linux this does not appear to be working. I assume this is because it’s not using the system wide fontconfig library, but an embedded one.

I looked in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/fontconfig and noticed it’s only caching fonts from /usr/lib/plexmediaserver/Resources/Fonts exclusively. Is this by design?

As an experiment I did the following:

  • cd /usr/lib/plexmediaserver/Resources/Fonts
  • sudo ln -s /usr/share/fonts usr-share-fonts
  • sudo ln -s /usr/local/share/fonts usr-local-share-fonts

Then I restarted the server, and tried playing a video. Now I can see all the fonts listed in Cache/fontconfig, so that’s good.

Am I missing something more obvious? Shouldn’t it be searching the standard font locations, or have a way to configure additional directories to look in?

PMS doesn’t use the system fonts. It brings all its fonts with it in each package.

The Mac version did. Why is the Linux version less functional?

To be clear, sometimes my media files need additional fonts to look right when subs are transcoded in (most of the time for me). Embedding the right fonts in each and every file to get that to work would be a waste of time and storage. On the Mac install this worked if I installed the fonts. This doesn’t work on Linux with the same files. It seems like it should.

Did you look at /usr/lib/plexmediaserver/Resources/Fonts ?
You’ll see the TTF fonts

I don’t see why you couldn’t add your own to that.

Like I said, I symlinked the standard font directories into /usr/lib/plexmediaserver/Resources/Fonts and I can see all the .ttf and .otf fonts listed in Plex’s cache files now, so I guess I’m probably ok, but:

  • will the links survive an upgrade?
  • why does it behave this way? I get that it has it’s own fontconfig rather than the system one, but why not add the standard paths to its config, or have an option on the server to optionally include them.

Nothing in /usr/lib/plexmediaserver survives upgrades.
The Linux package managers (dpkg and rpm erase before installing the updated binaries)

It is this way , AFAIK (but can ask), so the experience is the same regardless of which server platform is being used.

If you could ask, I’d appreciate it. Unless it changed recently it’s definitely not like this on the Mac. Maybe that’s a bug in the Mac implementation, but it was a feature I relied on heavily, and was thankful for.

Could it be that transcoding SSA/ASS subtitles wasn’t considered when this was done? It seems suboptimal for that application. I don’t just want to copy the fonts in since the ones in /usr/share/fonts are also managed by dpkg and if/when they update I don’t want to have to think about it.

If I have to I’ll make an apt trigger to restore the symlinks after the package is upgraded, but it seems like a hack for something that should just work. Fontconfig already deals with grabbing the highest version of a given font when it’s found multiple times so there shouldn’t be an issue if the Plex supplied fonts are already on the system.

Thanks for your help.

So I know specifically what to ask,

Is this for server burned-in fonts -or- is this for how text-based subtitles are rendered in the browser / media player ?

External (or embedded in MKV) ASS subtitles. PMS transcodes when subs are on and burns them in (to Roku, for example). Subtitle file has styles requesting specific fonts. Said fonts are in system wide folders. PMS ends up falling back to shipped fonts. I think that’s everything.

Thanks!

I have the same issue in unraid, when I use Direct Stream/Direct Play the fonts works without any issue,
but when I transcoding it, it gives me a weird shape.
Back in the day when I was using windows all I have to do is installing the fonts that being used in ASS file, even in SRT when it not used the default font.

unraid Direct Stream/Direct Play:

Imgur

unraid transcoding:

Imgur

windows Direct Stream/Direct Play:

Imgur

windows transcoding:

Imgur

I am trying to see if I can replicate this. If I can then I will show the steps to reproduce and submit .

Any input is welcomed.

thank you…

Rather than a video tutorial, care to write out an outline?
If you do the video then I must convert to written instructions anyway (which I might make a mistake with). Everything is written down because the development staff is in different timezones.

Write in your language. I will use Google to translate back and forth if we need to.
I do not mind the extra steps.

I have found it works pretty well. I’m willing to try if you are :slight_smile:
I am also bilingual so do understand more than the average person.

I have done some checking.

PMS will look in the Resources/Fonts directory.
This is by design because of all the different possible “System wide fonts” mechanisms. Keeping them in one location is far easier for everyone involved.
It also means that if an unusual font is needed, it’s up to the person wanting it to add.
Putting the files there is much easier than trying to install custom fonts on some platforms and maintaining the documentation for each specific system.

This is an incredibly disappointing answer. Then there needs to be a configuration option to specify additional search location. Something that will survive an upgrade. Plex doesn’t delete my media files on upgrade and I see no difference here.

What Linux distributions don’t use /usr/share/fonts and /usr/local/share/fonts?

Debian, Ubuntu, RedHat, and SUSE all do.

It looks like by default Slackware, Arch, and Mint use just /usr/share/fonts, but checking both locations would have no downside if one didn’t exist.

This sparks an idea. :thinking:

Time for me to go digging.

What if: ${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Fonts
were just such a place ?

That would be

That would be workable. Bonus if I could just symlink files/folders into that location.

Symlinks are dangerous. Dangerous because potential abuse crossing container/vm boundaries. I’ve had things blow up because of those context boundaries.

I’m about to go into my staff meeting. I’ll bounce the idea around.

1 Like