1.0.1 • Published 6 years ago

ngx-txt-img v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

ngx-txt-img

Alt text

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 ngx-txt-img --save

Consuming library

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

$ npm install ngx-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 { NgxTxtImgModule } from './modules/ngx-txt-img/ngx-txt-img.module';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule, NgxTxtImgModule
  ],
  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>
<ngx-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">
</ngx-txt-img>

Component

selector : ngx-txt-img

Configurable options available

KeyDefault ValueUse
height: numberdefault:200any number
width : numberdefault:200any number
action : stringdefault: TEXTTEXT
align: stringdefault: CenterCenter, left, right
content : stringdefault: Hello World.....any text....
left-margin:numberdefault: 5050
top-margin : numberdefault: 50margin from top for text content
line-height:numberdefault: 3050
tbackground:stringdefault: Black(color/URL) color string or a URL of an Image
tcolor : stringdefault: BlackColor of the Text
tfont : stringdefault: 30px Comic Sans MSFont of the Text
filter: stringdefault: '''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