Font Icons

Overview

Font icons are highly customizable vector-based symbols and icons embedded in font files, where specific character codes are mapped to icons instead of traditional letters or numbers. You can use them to provide helpful visual cues to your timeline.

Using Font Icons

Font icons can be used to style different types of KronoGraph items. Use them with:

  • Entities, using their associated glyph, as shown in the Font Icons story
  • Events, also shown in the Font Icons story. Note that KronoGraph automatically calculates whether there's enough space for them, and only displays them when:
    • There's enough room for them between individual events, as you zoom in.
    • The standardRowHeight is set to 20 or more.
  • Glyphs, as illustrated in the Styling Glyphs story
  • Markers, as demonstrated in the Markers story.

You can set the font family for each icon using fontFamily. Use escaped character code values in the text property to set the specific font icon:

const entities = {
  'Person 1': {
    fontIcon: {
      fontFamily: 'Font Awesome 6 Free',
      fontWeight: 900, // use the 'solid' font icon
      text: '\u{f1b9}', // car icon
    },
  },
};

const events = {
  'email 1': {
    entityIds: ['Person 1'],
    time: new Date(2025, 7, 14, 9, 27),
    fontIcon: {
      fontFamily: 'Font Awesome 6 Free',
      fontWeight: 900,
      text: '\u{f2b6}', // open envelope icon
    },
  },
};

Loading Font Icons

Fonts must be loaded into the page before they can be used in KronoGraph.

Modern browsers support the native fonts.load() function, so we've used this throughout our examples, but you can also use dedicated font-loading libraries such as Web Font Loader.

Note that when using fonts.load() you must ensure that the fonts have finished loading before creating your timeline, adding your Timeline component, or KronoGraph will be unable to render them. This is illustrated in the snippet below and the Font Icons story.

const fontAwesomeSolid = '900 16px "Font Awesome 6 Free"';
document.fonts.load(fontAwesomeSolid);

document.fonts.ready.then(() => {
  const timeline = createTimeline('my-timeline');
  timeline.set({ entities, events });
});
const loadFonts = () => {
  const fontAwesomeSolid = '900 16px "Font Awesome 6 Free"';
  document.fonts.load(fontAwesomeSolid);
};

export const MyComponent = () => {
  const [fontsReady, setFontsReady] = React.useState(false);

  loadFonts();
  document.fonts.ready.then(() => {
    setFontsReady(true);
  });

  if (!fontsReady) {
    return null;
  }

  return (
    <Timeline
      entities={entities}
      events={events}
    />
  );
};

Terms of use

These terms do not alter or supersede any existing agreements between you (or your employer) and us.

By accessing or using any Content you agree to be bound by these Terms of Use. Please review these terms carefully before using the website.

The contents of this website, including but not limited to any text, code samples, API references, schemas, interactive tools, and other materials (collectively, the 'Content'), are made available for informational and internal evaluation purposes only. All intellectual property rights in the Content are reserved. No licence is granted to use the Content for any commercial purpose, or to copy, distribute, modify, reverse-engineer, or incorporate any part of the Content into any product or service, without our prior written consent.

This Content is provided “as is” and “as available,” without any representations, warranties, or guarantees of any kind, whether express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, non-infringement, or accuracy. To the fullest extent permitted by applicable law, we expressly exclude and disclaim all implied warranties, conditions, and other terms that might otherwise be implied.

We disclaim all liability for any loss or damage, whether direct, indirect, incidental, consequential, or otherwise, arising from any reliance placed on the Content or from your use of it, to the fullest extent permitted by applicable law. By continuing to access or use the Content, you acknowledge and agree to these terms.