Custom fonts issue
Collabora Online doesn't load custom fonts uploaded on Nextcloud using remote_font_config.
I've found out that /apps/richdocuments/settings/fonts.json contains escaped slashes in fonts urls and for some reason Collabora doesn't load them.
If JSON_UNESCAPED_SLASHES added to json_encode() in JSONResponse::render() it starts to work properly.
Not sure if it's a beauty workaround but it works if a new class JSONFontResponse implemented like:
class JSONFontsResponse extends JSONResponse {
public function render() {
return json_encode($this->data, JSON_HEX_TAG | JSON_THROW_ON_ERROR | JSON_UNESCAPED_SLASHES);
}
}
then SettingsController::getJsonFontList() gets amended in https://github.com/nextcloud/richdocuments/blob/main/lib/Controller/SettingsController.php#L309
-- $response = new JSONResponse($fontList);
++ $response = new JSONFontsResponse($fontList);
Will need to check, maybe there was an upstream change in online that caused this? @pedropintosilva Do you have any insight there?
What version(s)? You skipped our bug report template. :)
I don't see escaping in my test instance (which was a little surprising, honestly).
Closing as there is no feedback.
@vladimirdulov Please don't hesitate to reopen once provided the additional insights