Skip to main content

display.resources

since 0.9.6
display.resourcesJavaScriptresourcesJavaScriptdisplay.resourcesJSONresourcesJSONDisplay.Resources.netdisplay.resourcesAndroid

Description​

Allows adjusting of the used fonts and colors for rendering. AlphaTab allows configuring the colors and fonts used for rendering via the rendering resources settings. Please note that as of today this is the primary way of changing the way how alphaTab styles elements. CSS styling in the browser cannot be guaranteed to work due to its flexibility.

Due to space reasons in the following table the common prefix of the settings are removed. Please refer to these examples to eliminate confusion on the usage:

PlatformPrefixExample Usage
JavaScriptdisplay.resources.settings.display.resources.wordsFont = ...
JSONdisplay.resources.var settings = { display: { resources: { wordsFonts: '...'} } };
JSONresources.var settings = { resources: { wordsFonts: '...'} };
.netDisplay.Resources.settings.Display.Resources.WordsFonts = ...
Androiddisplay.resources.settings.display.resources.wordsFonts = ...

Types​

Fonts​

For the JavaScript platform any font that might be installed on the client machines can be used. Any additional fonts can be added via WebFonts. The rendering of the score will be delayed until it is detected that the font was loaded. Simply use any CSS font property compliant string as configuration. Relative font sizes with percentual values are not supported, remaining values will be considered if supported.

since 1.2.3 Multiple fonts are also supported for the Web version. alphaTab will check if any of the fonts in the list is loaded instead of all. If none is available at the time alphaTab is initialized, it will try to initiate the load of the specified fonts individual through the Browser Font APIs.

For the .net platform any installed font on the system can be used. Simply construct the Font object to configure your desired fonts.

Colors​

For JavaScript you can use any CSS font property compliant string. (#RGB, #RGBA, #RRGGBB, #RRGGBBAA, rgb(r,g,b), rgba(r,g,b,a) )

On .net simply construct the Color object to configure your desired color.

resources: RenderingResources = false;

RenderingResources​

Following resources exist for adjusting the style.

Description

This public class contains central definitions for controlling the visual appearance.

 class RenderingResources

Properties

barNumberColorColor`rgb(200, 0, 0)`

The color to use for displaying the bar numbers above the music sheet.

barNumberFontFont`11px Arial, sans-serif`

The font to use for displaying the bar numbers above the music sheet.

barSeparatorColorColor`rgb(34, 34, 17)`

The color to use for rendering bar separators, the accolade and repeat signs.

copyrightFontFont`bold 12px Arial, sans-serif`

The font to use for displaying the songs copyright information in the header of the music sheet.

directionsFontFont`14px Georgia, serif`

The font to use for displaying the directions texts.

effectFontFont`italic 12px Georgia, serif`

The font to use for displaying certain effect related elements in the music sheet.

fingeringFontFont`14px Georgia, serif`

The font to use for displaying finger information in the music sheet.

fretboardNumberFontFont`11px Arial, sans-serif`

The font to use for displaying the fretboard numbers in chord diagrams.

graceFontFont`11px Arial, sans-serif`

The font to use for grace notation related texts in the music sheet.

inlineFingeringFontFont`12px Georgia, serif`

The font to use for displaying finger information when inline into the music sheet.

mainGlyphColorColor`rgb(0, 0, 0)`

The color to use for music notation elements of the primary voice.

markerFontFont`bold 14px Georgia, serif`

The font to use for section marker labels shown above the music sheet.

numberedNotationFontFont`14px Arial, sans-serif`

The font to use for displaying the numbered music notation in the music sheet.

numberedNotationGraceFontFont`16px Arial, sans-serif`

The font to use for displaying the grace notes in numbered music notation in the music sheet.

scoreInfoColorColor`rgb(0, 0, 0)`

The color to use for displaying the song information above the music sheets.

secondaryGlyphColorColor`rgb(0,0,0,0.4)`

The color to use for music notation elements of the secondary voices.

staffLineColorColor`rgb(165, 165, 165)`

The color to use for rendering the lines of staves.

subTitleFontFont`20px Georgia, serif`

The font to use for displaying the songs subtitle in the header of the music sheet.

tablatureFontFont`13px Arial, sans-serif`

The font to use for displaying the guitar tablature numbers in the music sheet.

timerFontFont`12px Georgia, serif`

The font to use for displaying beat time information in the music sheet.

titleFontFont`32px Georgia, serif`

The font to use for displaying the songs title in the header of the music sheet.

wordsFontFont`15px Arial, sans-serif`

The font to use for displaying the lyrics information in the header of the music sheet.