Skip to content

How to use DMD fonts

MPF includes three built-in fonts which are pre-configured as widget styles which look good on DMDs. These fonts are included in the MPF-MC package. They can be used with any widget that uses fonts, including the Text and Text Input widgets.

If you don't use one of these fonts on your DMD and just show some text, here's what the results look like:

slides:
  my_slide:
    - type: text
      text: MISSION
#! slide_player:
#!   show_slide_event: my_slide
##! test
#! post show_slide_event
#! advance_time_and_run .1
#! assert_slide_on_top my_slide
#! assert_text_on_top_slide MISSION

image

Sure, it works, but it doesn't look good because the default font is a regular font that's made for a high-res display.

Instead you can use these three styles. (Of course you can use your own fonts too, but sometimes it's hard to find ones that look good on a low-res DMD.)

style: big

big is 10 pixels tall.

slides:
  my_slide:
    - type: text
      style: big
      text: MISSION
#! slide_player:
#!   show_slide_event: my_slide
##! test
#! post show_slide_event
#! advance_time_and_run .1
#! assert_slide_on_top my_slide
#! assert_text_on_top_slide MISSION

image

style: med

medium is 7 pixels tall.

slides:
  my_slide:
    - type: text
      style: medium
      text: MISSION
#! slide_player:
#!   show_slide_event: my_slide
##! test
#! post show_slide_event
#! advance_time_and_run .1
#! assert_slide_on_top my_slide
#! assert_text_on_top_slide MISSION

image

style: small

small is 5 pixels tall.

Notice that this font has a color set and we're using it with a Color DMD. All three of these fonts (like any font) can be used on a mono or color DMD.

slides:
  my_slide:
    - type: text
      style: small
      text: MISSION
      color: 00ffcc
#! slide_player:
#!   show_slide_event: my_slide
##! test
#! post show_slide_event
#! advance_time_and_run .1
#! assert_slide_on_top my_slide
#! assert_text_on_top_slide MISSION

image


Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results