Custom Fonts in documentEditor

For our implementation of documentEditor in our angular app we need to set custom fonts in documentEditor. 

We get custom FontFamilies from the server wich we have to load and pass to the editor. We got this running only when passing the fontFamilies property as Input to the Editor like so:

[documentEditorSettings]="settings" and settings is: { fontFamilies: ["Arial", "Times, "Whateverfont"]},

Probem is that we need to change these settings during runtime when user selects another letter-template there might be another custom-font assosiated with the template. So we tried to set the fontFamilies Property programmatically like so:

this.container.documentEditorSettings.fontFamilies = ["Arial","Times"];

or

this.container.documentEditor.documentEditorSettings.fontFamilies = ["Arial","Times"];

or

this.container.documentEditor.setProperties({ fontFamilies: ["Times"]);

Neither of them worked.

We tried to set this in the "onCreate()" hook were we can be sure that this.container and this.container.documentEditor are not null.

Any ideas how to set/change the fonts during runtime ?


Thanks in advance


Thomas





3 Replies

AE Ajithamarlin Edward Syncfusion Team March 30, 2022 03:45 PM UTC

Hi Thomas,


We have checked your use case scenario, while changing the custom font families in runtime, the documentEditorSettings.fontFamilies values were changes internally or changes in source level but it was not reflected in the UI level, that is the font family list in the dropdown was not changed.


Can you please confirm, whether this was the issue that you were reported.


Regards,

Ajithamarlin E



TH Thomas Haaf March 31, 2022 06:31 AM UTC

Its not only the font dropdown wich is not updated, we also didn't manage to get the current selected font running with documentEditorSettings.fontFamilies.

The custom font only worked when we set the documentEditor Settings as input property. Then we had the custom font reflected in the dropdown and we were able to select it programmatically as default-font. Neither of this worked with documentEditorSettings.fontFamilies property in the created-lifecycle hook of the editor.


Regards

Thomas



AE Ajithamarlin Edward Syncfusion Team April 1, 2022 02:35 PM UTC

Hi Thomas,


We are sorry to say that, it is not possible to set/change the fonts during runtime.


Regards,

Ajithamarlin E


Loader.
Up arrow icon