Skip to main content

WBD Output step : how to use a local font ?

Maxime avatar
Written by Maxime
Updated over 3 weeks ago

Question

We are using the WBD Output step in document flow to process WebDesigner templates. We would like to be able to use a locally installed font. How can we do this?

Answer

You can solve this by defining the font you want to use in the css of the theme that is used in the template.

/**********************************************************
        Local font
**********************************************************/
@font-face {
  font-family: 'MyFont';
  src: url("file:///C:/Windows/Fonts/GIGI.TTF")
}

And by referencing this new font in your css

body {
    margin: 0;
    font-family: 'MyFont';
    font-size: 9pt;
  }  

However, this font will only be used during the creation of the output. Since the font is stored locally, the WebDesigner cannot access it and therefore will not be able to use the font to generate a preview.

To optimize this you can choose an available web font that you can see on screen, next to the local font to be used at print time.

@media screen {
  body {
    font-family: Arial;
    font-size: 9pt;
  }
}

@media print {
  body {
    font-family: 'MyFont';
    font-size: 9pt;
  }    
}

body {
  margin: 0;
}

For print output you will use the defined 'MyFont', for screen output (preview, html, email, ...) simply Arial.

Did this answer your question?