UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

169 lines (168 loc) 7.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_CONFIG = exports.CONFIG = void 0; const schema_1 = require("./schema"); exports.CONFIG = { DRAWING_BACKEND: schema_1.t.enum({ defaultValue: 'svg', help: 'DRAWING_BACKEND specifies the rendering backend to use.', choices: ['svg', 'canvas'], }), WIDTH: schema_1.t.number({ defaultValue: null, help: 'WIDTH specifies the width of the rendered score.', }), HEIGHT: schema_1.t.number({ defaultValue: null, help: 'HEIGHT specifies the maximum height of the rendered score.', }), INPUT_TYPE: schema_1.t.enum({ defaultValue: 'auto', help: 'INPUT_TYPE specifies the type of input to use.', choices: ['auto', 'mouse', 'touch', 'hybrid', 'none'], }), DEFAULT_PLAYBACK_BPM: schema_1.t.number({ defaultValue: 100, help: 'DEFAULT_PLAYBACK_BPM is the default beats per minute value used for playback. ' + 'It can get overridden by metronomes specified in the original document.', }), SCORE_PADDING_TOP: schema_1.t.number({ defaultValue: 40, help: 'TOP_PADDING is the vertical distance from the top of the rendering.', }), SCORE_PADDING_BOTTOM: schema_1.t.number({ defaultValue: 40, help: 'SCORE_PADDING_BOTTOM is the vertical distance from the bottom of the rendering.', }), TITLE_FONT_FAMILY: schema_1.t.string({ defaultValue: 'Arial', help: 'TITLE_FONT_FAMILY is the font family for the title.', }), TITLE_FONT_SIZE: schema_1.t.string({ defaultValue: '36px', help: 'TITLE_FONT_SIZE is the font size for the title expressed in browser-compatible units.', }), TITLE_FONT_LINE_HEIGHT_PX: schema_1.t.number({ defaultValue: 40, help: 'TITLE_FONT_LINE_HEIGHT is the line height for the title in pixels', }), TITLE_PADDING_BOTTOM: schema_1.t.number({ defaultValue: 20, help: 'TITLE_BOTTOM_PADDING is the vertical distance from the title to the first system.', }), SYSTEM_MARGIN_BOTTOM: schema_1.t.number({ defaultValue: 40, help: 'SYSTEM_MARGIN_BOTTOM is the vertical distance between systems', }), LAST_SYSTEM_WIDTH_STRETCH_THRESHOLD: schema_1.t.number({ defaultValue: 0.75, help: 'LAST_SYSTEM_WIDTH_STRETCH_THRESHOLD is the total width fraction that the measures must exceed to stretch the ' + 'measures in the last system.', }), PART_LABEL_FONT_FAMILY: schema_1.t.string({ defaultValue: 'Arial', help: 'PART_LABEL_FONT_FAMILY is the font family for part names.', }), PART_LABEL_FONT_SIZE: schema_1.t.string({ defaultValue: '13px', help: 'PART_LABEL_FONT_SIZE is the font size for part names expressed in browser-compatible units.', }), PART_LABEL_PADDING_RIGHT: schema_1.t.number({ defaultValue: 8, help: 'PART_LABEL_PADDING_RIGHT is the horizontal distance from part labels to the first measure.', }), PART_LABEL_ALIGNMENT: schema_1.t.enum({ defaultValue: 'right', help: 'PART_LABEL_ALIGNMENT is the horizontal alignment of part labels.', choices: ['right', 'left'], }), PART_MARGIN_BOTTOM: schema_1.t.number({ defaultValue: 40, help: 'PART_MARGIN_BOTTOM is the vertical distance between parts of a system.' + "It won't have an effect if there is only one part.", }), DEFAULT_STAVE_MARGIN_BOTTOM: schema_1.t.number({ defaultValue: 40, help: 'DEFAULT_STAVE_MARGIN_BOTTOM is the margin between staves within the same part and system. ' + "It won't have an effect if there is only one stave per part.", }), BASE_VOICE_WIDTH: schema_1.t.number({ defaultValue: 80, help: 'BASE_VOICE_WIDTH is how much extra width to give voices when calculating stave minimum width.', }), BASE_MULTI_REST_MEASURE_WIDTH: schema_1.t.number({ defaultValue: 150, help: 'MULTI_REST_MEASURE_WIDTH is how much extra width to give multi-rest measures ' + 'when calculating stave minimum width.', }), SHOW_TAB_CLEF: schema_1.t.boolean({ defaultValue: true, help: 'SHOW_TAB_CLEF specifies whether to show the tab clef.', }), SHOW_TAB_TIME_SIGNATURE: schema_1.t.boolean({ defaultValue: false, help: 'SHOW_TAB_TIME_SIGNATURE specifies whether to show the time signature for tab staves.', }), SHOW_TAB_STEMS: schema_1.t.boolean({ defaultValue: false, help: 'SHOW_TAB_STEMS specifies whether to show stems for tab staves.', }), MEASURE_LABELING_SCHEME: schema_1.t.enum({ choices: ['all', 'every2', 'every3', 'system', 'none'], defaultValue: 'all', help: 'MEASURE_LABELING_SCHEME is the scheme for showing measure labels.', }), DEFAULT_GAP_OVERLAY_FONT_SIZE: schema_1.t.string({ defaultValue: '12px', help: 'DEFAULT_GAP_OVERLAY_FONT_SIZE is the font size for gap overlays.', }), DEFAULT_GAP_OVERLAY_FONT_FAMILY: schema_1.t.string({ defaultValue: 'Arial', help: 'DEFAULT_GAP_OVERLAY_FONT_FAMILY is the font family for gap overlays.', }), DEFAULT_GAP_OVERLAY_FONT_COLOR: schema_1.t.string({ defaultValue: 'black', help: 'DEFAULT_GAP_OVERLAY_FONT_COLOR is the font color for gap overlays.', }), DEFAULT_GAP_OVERLAY_FILL_COLOR: schema_1.t.string({ defaultValue: 'rgba(255, 255, 255, 0.95)', help: 'DEFAULT_GAP_OVERLAY_FILL_COLOR is the fill color for gap overlays.', }), DEBUG_DRAW_SYSTEM_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_SYSTEM_RECTS enables drawing of system rectangles for debugging purposes', }), DEBUG_DRAW_MEASURE_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_MEASURE_RECTS enables drawing of measure rectangles for debugging purposes.', }), DEBUG_DRAW_FRAGMENT_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_FRAGMENT_RECTS enables drawing of fragment rectangles for debugging purposes.', }), DEBUG_DRAW_PART_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_PART_RECTS enables drawing of part rectangles for debugging purposes.', }), DEBUG_DRAW_STAVE_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_STAVE_RECTS enables drawing of stave rectangles for debugging purposes.', }), DEBUG_DRAW_STAVE_INTRINSIC_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_STAVE_INTRINSIC_RECTS enables drawing of stave intrinsic rectangles for debugging purposes.', }), DEBUG_DRAW_STAVE_PLAYABLE_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_STAVE_PLAYABLE_RECTS enables drawing of stave playable rectangles for debugging purposes.', }), DEBUG_DRAW_VOICE_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_VOICE_RECTS enables drawing of voice rectangles for debugging purposes.', }), DEBUG_DRAW_VOICE_ENTRY_RECTS: schema_1.t.boolean({ defaultValue: false, help: 'DEBUG_DRAW_VOICE_ENTRY_RECTS enables drawing of voice entry rectangles for debugging purposes.', }), }; exports.DEFAULT_CONFIG = schema_1.t.defaultConfig(exports.CONFIG);