rt-define-stroke-width
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

About

RT Define Stroke Width

Provides service that might calculate stroke width with specific CSS rules applied.

Usage

Add RtDefineStrokeWidthModule in imports into your module:

import {RtDefineStrokeWidthModule} from 'rt-define-stroke-width';

@NgModule({
  ...
  imports: [
    ...
    RtDefineStrokeWidthModule,
    ...
  ],
  ...
})
export class YourModule {
}  

Add RtDefineStrokeWidthService into constructor in your component and call getTextWidth method when needed.

Api

Service API:

  • getTextWidth - Defines width for stroke with specific CSS rules.

Example

Simple usage:

  constructor(private defineStrokeWidth: RtDefineStrokeWidthService) {
    this.strokeWidth = this.defineStrokeWidth.getTextWidth('text', 'font-size: 12px; font-family: Arial, sans-serif;');
  }

https://www.regulus.team/

Package Sidebar

Install

npm i rt-define-stroke-width

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

16.1 kB

Total Files

14

Last publish

Collaborators

  • andriy_podolian