0.2.3 • Published 6 years ago

txt-img v0.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

txt-img

The AngularJS Component was developed for a reason where it was really important to render image instead of text on the fly.

You can also use this package to convert from text to image and then save it.

Installation

To install this library, run:

$ npm install txt-img --save

Consuming your library

You can import your library in any Angular application by running:

$ npm install txt-img

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { TxtImgModule } from 'txt-img';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    
    TxtImgModule
    // Specify your library as an import
    
    LibraryModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported, you can use its components, directives and pipes in your Angular application:

<!-- You can now use your library component in app.component.html -->
<h1>
  {{title}}
</h1>
<txt-img 
  width = 300 
  height = 300 
  tbackground="Green" 
  left-margin=70 
  tcolor="Yellow" 
  action="TEXT" 
  filter= "blur(1px)grayscale(20)"
  content="Nice to see this text wrapped as Image" 
  tfont="30px Times New Roman">
</txt-img>

Component API

selector : txt-img

  Properties                  Default               values

height: number      | default:200                 | any number
width : number      | default:200                 | any number
action : string     | default: TEXT               | TEXT 
align: string       | default: Center             | Center, left, right
content : string    | default: Hello World        | .....any text....
left-margin:number  | default: 50                 | 50
top-margin : number | default: 50                 | margin from top for text content
line-height:number  | default: 30                 | 50
tbackground:string  | default: Black              | (color/URL) color string or a URL of an Image 
tcolor : string     | default: Black              | Color of the Text
tfont : string      | default: 30px Comic Sans MS | Font of the Text

filter: string      | default: ''                 | 'blur(5px)grayscale(20)' | All Css filters supported

Issues

Please report bugs and issues here.

Docs

Get a complete detail here

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

To lint all *.ts files:

$ npm run lint

Change log

v0.2.1

  • Working filters

License

MIT © Sourabh Rustagi

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago