OpenSheetMusicDisplay
    Preparing search index...

    Interface ITextMeasurer

    interface ITextMeasurer {
        fontSize: number;
        fontSizeStandard: number;
        computeTextWidthInCssFont?(text: string, cssFont: string): number;
        computeTextWidthToHeightRatio(
            text: string,
            font: Fonts,
            style: FontStyles,
            fontFamily?: string,
            fontSize?: number,
        ): number;
        setFontSize(fontSize: number): number;
    }

    Implemented by

    Index

    Properties

    fontSize: number
    fontSizeStandard: number

    Methods

    • Computes the width of the text in pixels in a CSS font as VexFlow sets it, e.g. "10pt Arial", whose family can also be a generic family or a list, e.g. "10pt Courier New, monospace". Optional, so that measurers implementing the interface without it keep working. Without it, the texts in EngravingRules.VexFlowTextFontFamily get as much space as in VexFlow's fonts.

      Parameters

      • text: string
      • cssFont: string

      Returns number