How to use the @fortawesome/fontawesome-svg-core.text function in @fortawesome/fontawesome-svg-core

To help you get started, we’ve selected a few @fortawesome/fontawesome-svg-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FortAwesome / angular-fontawesome / src / lib / layers / layers-text.component.ts View on Github external
private updateContent(params: TextParams) {
    this.renderedHTML = this.sanitizer.bypassSecurityTrustHtml(text(this.content || '', params).html.join('\n'));
  }
}
github FortAwesome / vue-fontawesome / src / components / FontAwesomeLayersText.js View on Github external
render (createElement, context) {
    const { familyPrefix } = config
    const { props } = context

    const classes = objectWithKey('classes', [
      ...(props.counter ? [`${familyPrefix}-layers-counter`] : []),
      ...(props.position ? [`${familyPrefix}-layers-${props.position}`] : [])
    ]);

    const transform = objectWithKey('transform', (typeof props.transform === 'string') ? parse.transform(props.transform) : props.transform)

    const renderedText = text(props.value.toString(), { ...transform, ...classes })

    const { abstract } = renderedText

    if (props.counter) {
      abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '')
    }

    const convertCurry = convert.bind(null, createElement)

    return convertCurry(abstract[0], {}, context.data)
  }
}
github FortAwesome / vue-fontawesome / index.es.js View on Github external
render: function render(createElement, context) {
    var familyPrefix = config.familyPrefix;
    var props = context.props;


    var classes = objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));

    var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);

    var renderedText = text(props.value.toString(), _extends({}, transform, classes));

    var abstract = renderedText.abstract;


    if (props.counter) {
      abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
    }

    var convertCurry = convert.bind(null, createElement);

    return convertCurry(abstract[0], {}, context.data);
  }
};