1.8-rc1 Custom Fonts

The audit log confirms the route through the code as expected - unfortunately that doesn’t give me any extra information on the issue.

The same code paths are used for uploading other files.

saveFile for "Open Sans Regular" with storedAs = "", fileName = "OpenSans-Regular.ttf" to "79.ttf". Always Copy = "", Cloned = ""

Can you confirm that the file left in temp/ is named “OpenSans-Regular.ttf” ?

Yes - the name of the file in temp is exactly “OpenSans-Regular.ttf”.
I suspect that something in default installation of XAMPP might be interfering with fonts installation/rebuild module but as you see all Xibo prerequisite tests are passed. I haven’t manually disabled any system calls.

I’m at a loss really - the only thing I can suggest doing is adding some explicit logging in on the rename command here: https://github.com/xibosignage/xibo-cms/blob/develop/lib/Entity/Media.php#L743

Something like:

$this->getLog()->debug('Moving temporary file: ' . $libraryFolder . 'temp/' . $this->fileName);
$this->getLog()->debug('to: ' . $libraryFolder . $this->mediaId . '.' . $extension);

That will get us exactly the files and paths being logged.

OP replied with new logs containing:

Moving temporary file: <<redacted>>\temp/OpenSans-Regular.ttf
to: <<redacted>>\87.ttf

The <<redacted>> bit is an identical file path.


I have a new suggestion - can you try adding the following line after: https://github.com/xibosignage/xibo-cms/blob/develop/lib/Widget/Font.php#L95

$font->close();

This change partially helped.
The file is now copied and the font is visible and working.
The problem is that fonts.css file is generated in /temp (and is seems OK - it contains the new font) but it is not moved to library folder (the original file is still there).
But with the wrong file in library ckeditor works fine with the new font so it is not a very big problem.

OK, so i’ve created a bug for that, see: Cannot upload fonts · Issue #995 · xibosignage/xibo · GitHub

I think you will find that the font doesn’t work on the players - because they use the fonts.css file in the library. We’d need more logging to determine why the fonts.css file doesn’t get moved… I am suspecting a different issue.

You are correct - the player doesn’t display the new font.
I have moved the correct fonts.css file to library folder but that did not help.
In the player’s library folder I can see that new font file is downloaded by the player but the fonts.css file is not updated.

You can’t manually copy files to the library, you will do more harm than good (all of your fonts.css file downloads will be broken now).

^^ As I said ^^

I’ve manually restored the original file form a copy - hope it will be enough to repair downloads of fonts.css.

OK - please let me know what logs do you need. The problem is with font installation and font rebuild as well.

If the problem also occurs here then it would be easiest to get some logs by taking this transaction with logging switched on. Please can you use the report fault process as before?

Thanks for the additional logs, I think I understand the problem - patch here https://github.com/dasgarner/xibo-cms/commit/fd58ba642638ef5cb7ba5c0fc10be99dde2222c7

Please can you try it and let me know?

Thanks,
Dan

We are almost there :slight_smile:
The file is now properly generated and copied to library (during font upload and fonts rebuild as well). The only problem is that it is also left in the temp folder…

Peter

I have tested the display - the files (fonts.css and font file) are properly downloaded.
There is a problem because the font is still not used in the presentation but perhaps it is a different problem.
I will try to fix it myself.

We’re missing an unlink: Remove temporary fonts.css · dasgarner/xibo-cms@6a51762 · GitHub

Thanks for your help with this issue - much appreciated! I’ve marked the last post as the solution.

A post was split to a new topic: Custom Font not showing on Windows Player