mofron-comp-text
Advanced tools
Comparing version 0.7.4 to 0.8.0
19
index.js
@@ -15,4 +15,5 @@ /** | ||
try { | ||
super(po); | ||
super(); | ||
this.name('Text'); | ||
this.prmOpt(po); | ||
} catch (e) { | ||
@@ -32,3 +33,3 @@ console.error(e.stack); | ||
/* init vdom contents */ | ||
this.vdom().addChild( | ||
this.adom().addChild( | ||
new mf.Dom('div', this) | ||
@@ -40,8 +41,14 @@ ); | ||
/* set font */ | ||
let fnt = this.theme().font(0); | ||
if (null !== fnt) { | ||
} catch (e) { | ||
console.error(e.stack); | ||
throw e; | ||
} | ||
} | ||
themeConts (thm) { | ||
try { | ||
let fnt = thm.font(0); | ||
if ( (null !== fnt) && (null === this.font()) ) { | ||
this.font(fnt, true); | ||
} | ||
} catch (e) { | ||
@@ -48,0 +55,0 @@ console.error(e.stack); |
{ | ||
"name": "mofron-comp-text", | ||
"version": "0.7.4", | ||
"version": "0.8.0", | ||
"description": "text component for mofron", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# mofron-comp-text | ||
Base of Text Component for [mofron](https://github.com/simpart/mofron) | ||
Base of Text Component for [mofron](https://github.com/mofron/mofron) | ||
# sample | ||
please see [here](https://github.com/simpart/mofron) about an overview of mofron | ||
please see [here](https://github.com/mofron/mofron) about an overview of mofron | ||
```javascript | ||
let Mof = require('mofron'); | ||
let Txt = require('mofron-comp-text'); | ||
let mf = require('mofron'); | ||
let Text = require('mofron-comp-text'); | ||
new Txt({ | ||
param : 'TEST', // require | ||
size : 40 , | ||
color : new Mof.Color(255,0,0), | ||
font : new Mof.Font('serif'), | ||
new Text({ | ||
text : 'TEST', // require | ||
size : 40, | ||
color : new mf.Color(255,0,0), | ||
font : new mf.Font('serif'), | ||
space : 10, | ||
visible : true | ||
@@ -22,7 +23,8 @@ }); | ||
| Method | Parameter | Description | | ||
|:------------------|:-----------------------------------------------------------------|:-------------------------------| | ||
| text | string : text contents (option) | set parameter : update text contents<br>no parameter : get text contents | | ||
| size | number(px) : text size (option) | set parameter : update text size<br>no parameter : get text size | | ||
| color | object : color object (option) | set parameter : update text color<br>no parameter : get text color| | ||
| font | object : font object (option) | set parameter : update text font<br>no parameter : get text font| | ||
| Method | Parameter | Description | | ||
|:------------------|:--------------------------------------|:-------------------------------| | ||
| text | string : text contents (option) | set parameter : update text contents<br>no parameter : get text contents | | ||
| size | number(px) : text size (option) | set parameter : update text size<br>no parameter : get text size | | ||
| color | object : color object (option) | set parameter : update text color<br>no parameter : get text color| | ||
| font | object : font object (option) | set parameter : update text font<br>no parameter : get text font| | ||
| space | number(px) : letter spacing size | set parameter : update text space<br>no parameter : get text font| |
7966
178
30