Font Block

Using a font to create an Odyssey Brush requires several elements and steps. As elements, we can list :

  • a text to be written

  • an array of the whole font to be used

  • a stamp with the same size as the letter to be used from the array, and correctly placed in this array (based on its UV).

For instance, to be able to write “Hello World!**”, the Blueprint of your Odyssey Brush must be able to target the following characters properly on a chosen font:

../../../_images/odysseybrush-nodes-font-basics-helloworld.png

This is what we are going to see in this lesson. First, let’s summarize the nodes and variable related to fonts.

Nodes

Get Font Blocks

../../../_images/odysseybrush-nodes-font-block.png

This node requires an input Object, which must be a variable “Font”. The return value is an Array of Odyssey Block Reference Structure.

You will also find input to modify the Color Model and Chanel Depth.

Get Font Character Info

../../../_images/odysseybrush-nodes-font-character.png

This node also requires an input Object (a variable Font), plus a variable “String” which shall be used to enter the text you want to write with your Odyssey Brush.

Get Character Size

../../../_images/odysseybrush-nodes-font-size.png

This node also requires an input Object (”Font”) and a a variable “String”. The output Width and Height will return an array of Float values corresponding to the size of each characters written in “String”, according to the data from “Font”.

Break Odyssey Font Character

../../../_images/odysseybrush-nodes-font-break.png

This node will break data from Font Character such as:

  • Start U | Start V: starting point to draw the character on the font array (0,0 being Top Left corner). Use X and Y coordinates in pixels and return an Integer value.

  • U Size | V Size: Width and Height of the stamp in pixels. Return an Integer value.

  • Texture Index: The ID of the character used that returns a Byte value.

  • Vertical Offset : an offset in pixel that returns an Integer value.

This node is a necessary step to convert the character information into an Odyssey Block Reference Structure.

Make Odyssey Font Character

../../../_images/odysseybrush-nodes-font-make.png

This node will use data to create a Font Character. Input are the same as the output from “Break Odyssey Font Character”.

Useful Variables

  • Font

../../../_images/odysseybrush-nodes-font-make-variable-font.png
  • Odyssey Block Reference Structure

../../../_images/odysseybrush-nodes-font-make-variable-block.png
  • Odyssey Font Character

../../../_images/odysseybrush-nodes-font-make-variable-character.png

Adding a new Font

  1. Create the Font asset

The Font asset must be created in the Content Drawer. Make a right click in the “Content Drawer › User Interface › Font”.

../../../_images/odysseybrush-nodes-font-make-asset.png
  1. Set the Font

Double click on the newly created Font asset to get displayed this window:

../../../_images/odysseybrush-nodes-font-make-newfont.png

On the right, you will find the Detail panel. Change the Font Cache Type from “Runtime” to “Offline”. This warning shall pop up:

../../../_images/odysseybrush-nodes-font-make-warning.png

Click on “Yes” to get this panel:

  • Window

../../../_images/odysseybrush-nodes-font-make-select-win.png
  • Mac

../../../_images/odysseybrush-nodes-font-make-select-mac.png

Choose the font you want to use among the list of fonts available on your computer. Then, valid your choice by clicking on “Ok”. The font will be loaded in the asset:

../../../_images/odysseybrush-nodes-font-make-loaded.png

Note

Do not forget to save the change before closing the window.