Adding Custom Fonts to Digital Hive

Adding Custom Fonts to Digital Hive

Question

The corporate branding guidelines for our company mandates a specific font be used for all material. Examining the available fonts within Digital Hive, the required font is not listed. Is there a way to add the custom font so that it's available within Digital Hive?

Answer

Out of the box, Digital Hive provides a set of common fonts that can be used to modify the appearance of text within Hives. Certain scenarios may require for a non-standard or custom font to be leveraged. The reason for a different font could be simple aesthetics, or it could be to align to corporate design and branding requirements. Digital Hive makes it easy to extend the font list within the solution, all that is required is the css file for the font.
 

To accomplish this, access to the Operating System where Digital Hive is installed will be required. It is not possible to enable a custom font through the Digital Hive web interface.

With the required custom font css file accessible, the next steps will be to add the css file to the Digital Hive installation files.   

  1. On the Digital Hive server, open File Explorer  
  2. Navigate to the <install_directory>\app\node1\tomcat\webapps\theia\modules\myCustomFonts\fonts directory
  3. Create a new folder that will be the root for the custom font(s). In this example, the new folder was named Apparat
  4. Copy the css file for the new font into the Apparat folder. The result should look like this:



The next steps will be to add the font definition to the list of available fonts.
  1. Open the custom font css file and locate the font-family name and category. Look for an entry similar to this:
  2. In this example, the font-family name is apparat and the category is sans-serif


  3. Looking at the contents of the file, there should be entries similar to this:


  4. Note all the different unique font-styles and font-weight values. In this example, normal and italic are the font-styles and 300, 400, 600, 700 are the font-weights
  5. Close the file
  6. Navigate to the myCustomFonts folder and open the index.js file in a text editor
  7. Paste the bolded text below into the “main” section of the manifest.json file
      // First we import the CSS files for our typeface...
      importCSS('fonts/BloggerSans/BloggerSans.css');
      importCSS('fonts/BloggerSans/BloggerSans-Italic.css');
      importCSS('fonts/BloggerSans/BloggerSans-Bold.css');
      importCSS('fonts/BloggerSans/BloggerSans-BoldItalic.css');
     
    importCSS('fonts/Apparat/Apparat-preserve_css.css'); 

    Don’t forget to include the ; after the previous line otherwise the code snippet won’t be interpreted correctly

  8. Paste this snippet of code before the final }; characters at the end of the file 
       registerTypeface({
        fontId: 'apparat', // this needs to match the 'font-family' used in the CSS files
        fontName: 'Apparat', // Human-readable name
        weights: [300, 400, 600, 700],
        styles: ['normal', 'italic'],
        category: 'sans-serif'
      });
    Replace the fontID, weights, styles, and category values with the ones that were noted during the previous steps. The fontName value is what will appear in the Digital Hive UI

  9. Save the index.js file
   
The next steps will now modify the Digital Hive installation to recognize the new font type.   
 
  1. In the <install_directory>\app\node1\tomcat\webapps\theia directory, edit the config.json file
  2. Locate the "modules" entry and register the custom font by typing "myCustomFonts" between the square brackets [ ]
  3. The final line would be  "modules": ["myCustomFonts"],
  4. Save the config.json file

No restarting of any services is required. Simply a browser refresh. The custom font family has now been added to the Digital Hive installation. When users are presented with a UI to select a font, the new Apparat font will be available.




 
 

    • Related Articles

    • Adding Custom Metadata Fields to Enhance Digital Hive Content

      Question Looking at the properties for a report, there is metadata visible from the content systems like Tableau, PowerBI, and IBM Cognos Analytics, but is it possible to create custom metadata values on a report or dashboard. The objective is to ...
    • Creating a Custom Color Scheme

      Question Within Digital Hive, we can manually change color values, or use predefined color schemes, but is it possible to create a color scheme that can be saved and reused in the future? Answer Custom color screens can be created by Digital Hive ...
    • Adding Custom Icons to the Digital Hive Icon Library

      Question Although the default Digital Hive icon library contains over 2,000 icons, our company has specific icons that we need to incorporate into our Hive design. Is it possible to extend the default icon library, beyond the default libraries, to ...
    • How to Upload an Image file into Digital Hive as Author

      Question There are images that we would like to use during the creation of our Hives. As an Author, is there a way to upload the files to Digital Hive so that we don't have to connect to the File System or load the images into a Content Management ...
    • Digital Hive Load Balancing

      Question Due to the number of users and the critical nature of the BI reports, it is desirable to introduce more capacity into the Digital Hive environment. Can Digital Hive be installed across multiple servers? Answer Digital Hive can be installed ...