title: How can I get the fonts family and font styles in javafx?
body: <p>I can't seem to get just the font family without getting a bunch of font styles. Here is my code I am thinking of separating them using a .contains to check for light, bold, italic but that isn't very efficient.</p>
  
  <pre><code>for(String font : Font.getFontNames()){
              if(font.toLowerCase().contains("light") || font.contains("extrabold") || font.contains("extralight") || font.contains("light")){
  
              }
  
          fontsList.add(font);
          }
  </code></pre>
  
  <p>My display is this :
  Times New Roman</p>
  
  <p><strong>Times New Roman Bold</strong></p>
  
  <p><strong><em>Times New Roman Bold Italic</em></strong></p>
  
  <p><em>Times New Roman Italic</em></p>
  
  <p>But I only want to display the Time New Roman so only the font family.</p>