Installing Display Fonts
When the ePaper initialize block is used, it sets up the Propeller microcontroller to communicate with the ePaper module. The ePaper initialize block installs 1 small font, which allows you to print text and numbers to the ePaper module’s screen. You may want to use a medium or large sized font instead. In order to use different fonts, you will have to install them into the EEPROM memory on your Activity Board.
Upper EEPROM
The EEPROM memory on the Activity Board can hold up to 64 kilobytes (KB) of data. The first 32 KB is used to hold your programs when you click “Save to EEPROM”. The remaining memory — often called upper EEPROM — is used to hold information that can be accessed by the programs you write for your Activity Board.
The chart below illustrates how the EEPROM is used. When you install the ePaper fonts, they use about 23 KB of EEPROM memory:
If you look carefully at the example chart above (though your program may not have ActivityBot calibration data in the EEPROM), when fonts are installed, there are about 7.8 kilobytes available for other uses. In BlocklyProp, that area is accessible via the Memory > EEPROM blocks.
Load the Fonts
Installing the ePaper fonts does not actually require any circuits, not even the ePaper module itself. The program to install ePaper fonts is only a single block.
- Build the program shown above, just using the single COMMUNICATE > ePaper > Display font loader block:
- Click the Load and run (save code to EEPROM) button.
- Do not disconnect your board, click any buttons, or press any keys while the fonts are loading.
- The Terminal window will appear, and the P26/P27 LEDs will begin to blink. The install process takes about 1 minute to complete.
- Wait for your Terminal window to say “done” and the P26/P27 LED to turn off before disconnecting or turning off your Activity Board.
Did You Know?
Four Fonts, Three Sizes — The default Sans font style does not need the ePaper font loader block. But once you have loaded the ePaper font loader block project to EEPROM, you have the fancy Serif, Script, and Bubble fonts to use. Here are the sizes available to each font:
- Sans: (default) available in small, medium and large
- Serif: medium and large only
- Script: medium and large only
- Bubble: medium and large only
- Fixed-width & fixed-height fonts — This means that each character takes up the same amount of space. This makes it much easier to predict where characters will appear on your screen.
The width of each character increases by 6 pixels from small (6 pixels wide) to medium (12 pixels wide) to large (18 pixels wide). The height increases by 8 pixels from small (8 pixels tall) to medium (16 pixels tall) to large (24 pixels tall). Because there is a 1 pixel spacer on the right and top of each character, the actual character size is 1 pixel less:
Try This - Experimenting with Font Sizes
Now that you have loaded fonts to your Propeller board’s EEPROM, you are ready to experiment with those different fonts and sizes. By default, the ePaper print text block will use the Sans font in size small however you have other font and size options.
- Disable or remove the ePaper font loader block.
- Click on the link underneath each of the following images to open its corresponding block code example.
- Click the Run once button.
- Check that the output on your ePaper matches with its corresponding image.
- Trying combinations of words, fonts, and sizes until you are familiar with how the different options look together.
Sans
2.9" ePaper Font Display - Sans Blockly Code Example
Serif
2.9" ePaper Font Display - Serif Blockly Code Example
Script
2.9" ePaper Font Display - Script Blockly Code Example
Bubble
2.9" ePaper Font Display - Bubble Blockly Code Example
Your Turn — Change Color
By default, the ePaper print text block will use black text on a white background. The ePaper font color block adds another element of fun and functionality!
- Add the ePaper font color block to the Sans font block code linked below, just under the ePaper initialize block.
- Click in the ePaper font color block and set font color to black and background color to white background.
- Click Run once to see the effect.
- Try setting both blocks to white, and run it. What happens?
- Try setting font color to white, and font background color to black. What happens?
- Try different combinations of font and background, fonts, and font sizes to see which are easier to read, and which are harder. Make a note of your favorites.