Class MusicGlyphRenderer

java.lang.Object
com.softsynth.jmsl.score.MusicGlyphRenderer
Direct Known Subclasses:
AccidentalsMusicGlyphRenderer, BravuraMusicGlyphRenderer, MusicGlyphRendererProxy, SonataMusicGlyphRenderer

public abstract class MusicGlyphRenderer
extends java.lang.Object
  • Constructor Summary

    Constructors
    Constructor Description
    MusicGlyphRenderer()  
  • Method Summary

    Modifier and Type Method Description
    void createBaseFont​(java.io.File openTypeFile)  
    java.awt.Font getBaseFont()
    this is the font from which yoyu can derive other sizes and styles.
    double getFont_size_normalization_factor()
    this factor is used to find the point size of a font that aligns with graphics based on zoom
    abstract java.lang.String getFontName()  
    double getGlyphWidth​(java.awt.Graphics g, java.lang.String glyphToken, double zoom)  
    boolean isFontFound()
    check to see if Font is found on system, else return false
    void printAvailableSystemFonts()  
    abstract boolean render​(java.lang.String glyphToken, java.lang.Object parent, double x, double y, double zoom, java.awt.Graphics g)  
    abstract PositionedGlyph selectGlyph​(java.lang.String glyphToken, java.lang.Object parent, double x, double y, double zoom)  
    void setBaseFont​(java.awt.Font baseFont)  
    void setFont_size_normalization_factor​(double font_size_normalization_factor)
    this factor is used to find the point size of a font that aligns with graphics based on zoom.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MusicGlyphRenderer

      public MusicGlyphRenderer()
  • Method Details

    • createBaseFont

      public void createBaseFont​(java.io.File openTypeFile) throws java.awt.FontFormatException, java.io.IOException
      Throws:
      java.awt.FontFormatException
      java.io.IOException
    • getBaseFont

      public java.awt.Font getBaseFont()
      this is the font from which yoyu can derive other sizes and styles. Used if you are using OpnType fonts that Java does not se in system
      Returns:
      the baseFont
    • setBaseFont

      public void setBaseFont​(java.awt.Font baseFont)
      Parameters:
      baseFont - the baseFont to set
    • getFontName

      public abstract java.lang.String getFontName()
    • isFontFound

      public boolean isFontFound() throws java.awt.FontFormatException, java.io.IOException
      check to see if Font is found on system, else return false
      Throws:
      java.io.IOException
      java.awt.FontFormatException
    • printAvailableSystemFonts

      public void printAvailableSystemFonts()
    • getFont_size_normalization_factor

      public double getFont_size_normalization_factor()
      this factor is used to find the point size of a font that aligns with graphics based on zoom
      Returns:
      the font_size_normalization_factor
    • setFont_size_normalization_factor

      public void setFont_size_normalization_factor​(double font_size_normalization_factor)
      this factor is used to find the point size of a font that aligns with graphics based on zoom. Was 4 for Sonata, but trying smaller values for Bravura
      Parameters:
      font_size_normalization_factor - the font_size_normalization_factor to set
    • getGlyphWidth

      public double getGlyphWidth​(java.awt.Graphics g, java.lang.String glyphToken, double zoom)
    • selectGlyph

      public abstract PositionedGlyph selectGlyph​(java.lang.String glyphToken, java.lang.Object parent, double x, double y, double zoom)
    • render

      public abstract boolean render​(java.lang.String glyphToken, java.lang.Object parent, double x, double y, double zoom, java.awt.Graphics g)
      Returns:
      true if glyph is assigned and rendered