Utilities for estimating measure/system/page width and height

### Hierarchy

- SuiLayoutFormatter

## Index

### Constructors

- constructor

### Methods

- calculateBeginningSymbols
- checkPageBreak
- estimateColumn
- estimateMeasureHeight
- justifyY
- layout
- updateSystemMap

## Constructors

### constructor

- new SuiLayoutFormatter(score: SmoScore, svg: SvgPageMap, renderedPages: Record<number, null | RenderedPage>): SuiLayoutFormatter

- - Defined in src/render/sui/formatter.ts:59

  #### Parameters

  - ##### score: SmoScore

  - ##### svg: SvgPageMap

  - ##### renderedPages: Record<number, null | RenderedPage>

  #### Returns SuiLayoutFormatter

## Methods

### calculateBeginningSymbols

- calculateBeginningSymbols(systemIndex: number, measure: SmoMeasure, clefLast: string, keySigLast: string, timeSigLast: TimeSignature, tempoLast: SmoTempoText): void

- - Defined in src/render/sui/formatter.ts:624

  Calculate the dimensions of symbols based on where in a system we are, like whether we need to show the key signature, clef etc.

  #### Parameters

  - ##### systemIndex: number

  - ##### measure: SmoMeasure

  - ##### clefLast: string

  - ##### keySigLast: string

  - ##### timeSigLast: TimeSignature

  - ##### tempoLast: SmoTempoText

  #### Returns void

### checkPageBreak

- checkPageBreak(scoreLayout: ScaledPageLayout, currentLine: SmoMeasure[], bottomMeasure: SmoMeasure): ScaledPageLayout

- - Defined in src/render/sui/formatter.ts:114

  see if page breaks this boundary. If it does, bump the current page and move the system down to the new page

  #### Parameters

  - ##### scoreLayout: ScaledPageLayout

  - ##### currentLine: SmoMeasure[]

  - ##### bottomMeasure: SmoMeasure

  #### Returns ScaledPageLayout

### estimateColumn

- estimateColumn(scoreLayout: ScaledPageLayout, measureIx: number, systemIndex: number, lineIndex: number, x: number, y: number): MeasureEstimate

- - Defined in src/render/sui/formatter.ts:160

  Estimate the dimensions of a column when it's rendered.

  #### Parameters

  - ##### scoreLayout: ScaledPageLayout

  - ##### measureIx: number

  - ##### systemIndex: number

  - ##### lineIndex: number

  - ##### x: number

  - ##### y: number

  #### Returns MeasureEstimate

  - the measures in the column and the x, y location

### estimateMeasureHeight

- estimateMeasureHeight(measure: SmoMeasure): {}

- - Defined in src/render/sui/formatter.ts:666

  The baseline is the top line of the staff. aboveBaseline is a negative number that indicates how high above the baseline the measure goes. belowBaseline is a positive number that indicates how far below the baseline the measure goes. the height of the measure is below-above. Vex always renders a staff such that the y coordinate passed in for the stave is on the baseline.

  Note to past self: this was a really useful comment. Thank you.

  #### Parameters

  - ##### measure: SmoMeasure

  #### Returns {}

### justifyY

- justifyY(scoreLayout: ScaledPageLayout, rowCount: number, currentLine: SmoMeasure[], lastSystem: boolean): void

- - Defined in src/render/sui/formatter.ts:546

  A system has gone beyond the page width. Lop the last measure off the end and move it to the first measure of the next system. Then seal the last system by justifying the measures vertically and horinzontally

  #### Parameters

  - ##### scoreLayout: ScaledPageLayout

  - ##### rowCount: number

  - ##### currentLine: SmoMeasure[]

  - ##### lastSystem: boolean

  #### Returns void

### layout

- layout(): void

- - Defined in src/render/sui/formatter.ts:281

  Calculate the geometry for the entire score, based on estimated measure width and height.

  #### Returns void

### updateSystemMap

- updateSystemMap(measures: SmoMeasure[], lineIndex: number, systemIndex: number): void

- - Defined in src/render/sui/formatter.ts:81

  Once we know which line a measure is going on, make a map for it for easy looking during rendering

  #### Parameters

  - ##### measures: SmoMeasure[]

  - ##### lineIndex: number

  - ##### systemIndex: number

  #### Returns void

Generated using TypeDoc