I'm trying to add custom fonts of our client to the Document Editor.
The font's names are containing multiple whitespaces, this is the array I'm passing into the documentEditorSettings as fontFamilies property:
{
fontFamilies: ["HelveticaNeue LT 55 Roman", "HelveticaNeue LT 75 Bold", "HelveticaNeue LT 65 Medium", "HelveticaNeue LT 45 Light", "Open Sans", "Open Sans Semibold", "Arial"]
}
Additionally I defined font-faces in the styles.css of the angular application e.g.:
@font-face {
font-family: 'HelveticaNeue LT 75 Bold';
src: url('lte50261.woff') format('woff'), url('lte50261.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
The fonts are getting shown in the dropdown on the righthand side of the editor, but are not shown correctly in the option spans of the dropdown. I tracked the problem down to the code in documentEditor where the itemTemplate for the spans of the dropdown are provided as follows:
itemTemplate = '<span style="font-family: ${FontName};">${FontName}</span>';
This leads to an incorrect definition of the style attribute as the fonts should be added with quotes as the contain whitespaces.
Of course this problem can be avoided by changing the font's names, but that would make already existing word-documents incompatible, as they were created by using the actual font names.
Is there any possible way to avoid this issue?
Kind regards
Thomas