import { StyleDefinition } from './style-definition' ; import { IText } from '../interfaces' ; /**
 * Class to create a text definition
 */ export class Txt extends StyleDefinition < Txt , IText > { param text constructor ( private _text ) { super ( ) ; this . content . text = this . _text ; } /**
     * preserve leading spaces
     */ public preserveLeadingSpaces ( ) { this . content . preserveLeadingSpaces = true ; return this ; } /**
     * Set opacity to the text
     */ public opacity ( opacity ) { if ( opacity > 1 ) opacity = 1 ; this . content . opacity = opacity ; return this ; } }