Adding custom fonts
Learn how to add custom fonts to Analytics Content Hub.
By default, Analytics Content Hub provides a set of common fonts that you can use to modify the appearance of text within your applications. You can also add custom fonts to the already existing options.
Before you begin
You need a CSS file with the custom font definition.
Important: You can add custom fonts only from the operating system with Analytics
Content Hub installed. It is not possible to enable a custom font through web interface.
Procedure
- On the Analytics Content Hub server, open the File Explorer.
- Navigate to the <install_directory>\app\node1\tomcat\webapps\theia\modules\myCustomFonts\fonts directory.
- Create a folder that is the root folder for all custom fonts.
- Copy the CSS file with the custom font definition and paste it in the root folder.
- Go back to the myCustomFonts folder and open the index.js file in a text editor.
- Copy the following code snippet and paste it into the main section of the
manifest.json
file.
importCSS('fonts/folderName/fileName.css');
Replace the
folderName
with the root folder name andfileName
with CSS file name. - Copy the following code snippet and paste it at the end of the
manifest.json file, right before the closing
brace.
registerTypeface({ fontId: 'fontId', fontName: 'fontName', weights: [fontWeights], styles: [fontStyles], category: 'fontCategory' });
Replace the following values with real values that match the CSS font definition:
fontId
,fontName
,weights
,styles
, andcategory
. - Save the index.js file.
- Go to the <install_directory>\app\node1\tomcat\webapps\theia directory.
- Edit the config.json file.
- Find the
modules
entry and register the custom font as in the following code snippet:"modules": ["myCustomFonts"],
- Save the config.json file and refresh the browser.
The custom font is now available during Analytics Content Hub installation.