Label.ts 881 B

1234567891011121314151617181920212223242526272829
  1. import {TextAlignmentEnum} from "../Common/Enums/TextAlignment";
  2. import {OSMDColor} from "../Common/DataObjects/OSMDColor";
  3. import {Fonts} from "../Common/Enums/Fonts";
  4. import {FontStyles} from "../Common/Enums/FontStyles";
  5. /**
  6. * A text label on the graphical music sheet.
  7. * It is used e.g. for titles, composer names, instrument names and dynamic instructions.
  8. */
  9. export class Label {
  10. constructor(text: string = "", alignment: TextAlignmentEnum = TextAlignmentEnum.CenterBottom, font: Fonts = Fonts.TimesNewRoman) {
  11. this.text = text;
  12. this.textAlignment = alignment;
  13. this.font = font;
  14. }
  15. public text: string;
  16. public color: OSMDColor;
  17. public font: Fonts;
  18. public fontStyle: FontStyles;
  19. public fontHeight: number;
  20. public textAlignment: TextAlignmentEnum;
  21. public ToString(): string {
  22. return this.text;
  23. }
  24. }