title: How to set custom fonts in JavaFX Scene Builder using CSS
body: <p>I'm making a GUI in JavaFX Scene Builder and would like all text (Labels, Text Fields, Comboboxes) to use the same font. The problem is it's a custom font that likely won't be on every client's computer. </p>
  
  <p>I've tried CSS:</p>
  
  <pre><code>@font-face {
     font-family: DIN;
     src: url(DIN.tff);
  }
  
  .text {
     -fx-font-family: DIN;
     -fx-font-style: bold;
  }
  </code></pre>
  
  <p>Saved the above code to file <em>Font.css</em> and tried applying it to each GUI element through Scene Builder's <em>JavaFX CSS</em> fields, but it's not working.</p>
  
  <p>Have I made a mistake in the CSS? Or is there a better way to go about this? I'd prefer not to have to load the font and set it for every element in the Java code itself if I don't have to.</p>