plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!

question

Diagonalization avatar image
Diagonalization asked AmbitiousPilots answered

Possible to use a different font in a panel?

I want to use a fixed-width font in an in-game panel. However, style="font-family: ..." seems to have no effect. This is on a <textarea> element. Does the game deliberately limit the set of available fonts?

html
10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

mattnischan avatar image
mattnischan answered

The fonts available are not related to the system fonts at all. You will need to load the TTF font of your choice using the @font-face CSS directive, provided that font file exists in the VFS (i.e. in an existing sim package or in your own package):

@font-face {
  font-family: "RobotoMono-Light";
  src: url("/Fonts/RobotoMono-Light.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

The path should be relative to the html_ui folder, I believe.

-Matt | Working Title

10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

AmbitiousPilots avatar image
AmbitiousPilots answered

To add on to @mattnischan's answer, the fonts that come with FS are stored in html_ui/Fonts. Currently the available font families are: Arial, Barlow, Calibri, Consolas, Malgun, Mangal, Montserrat, Nirmalas, Roboto, Simsun and Vrinda. A custom font for the A1000 and icons are provided as well. When you want to use your own font, pack it in the html_ui/Fonts directory of your add-on and specify it in your css file using @font-face, as mentioned in the selected answer above.

10 |10000 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.