No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
publish
scripts
src
.gitignore
.travis.yml
README.md
tslint.json

README.md

Text Justify

Installation

Ideally it would be something like:

tns plugin add nativescript-text-justify

Usage

To establish a font type, it is necessary to create a directory assets > fonts with the fonts to be used:

Directory:

App_Resources > Android > src > main > <create paths> assets > fonts > <name>.ttf

Show demo for more info.

<Page
    xmlns="http://schemas.nativescript.org/tns.xsd"
    xmlns:textJustify="nativescript-text-justify"
    loaded="pageLoaded">
    <StackLayout>
        <textJustify:TextJustify
            textColor="black"
            textSize="22"
            textAlignment="true"
            textTypefacePath="robotoitalic.ttf"
            text="This text is for test, This text is for test, This text is for test, This text is for test.">
        </textJustify:TextJustify>
    </StackLayout>
</Page>

Angular

Add element in app.module.ts:

import { registerElement } from "nativescript-angular/element-registry";
import { TextJustify } from "nativescript-text-justify";

registerElement("TextJustify", () => TextJustify);

In .html:

<TextJustify
    textColor="black"
    textSize="22"
    textAlignment="true"
    textTypefacePath="robotoitalic.ttf"
    text="This text is for test, This text is for test, This text is for test, This text is for test."
>
</TextJustify>

API

Describe your plugin methods and properties here. See nativescript-feedback for example.

Property Default Description
text text: string Set the text
textAlignment textAlignment: boolean Set true for justified or false
textSize textSize: number Set textSize 1 and <= 23
textColor textColor: string Set textColor #RRGGBB 'white', 'black', etc..
textTypefacePath textTypefacePath: string Set textTypefacePath example: roboto.ttf

License

Apache License Version 2.0, January 2004