yunseok

한글 split

......@@ -2930,6 +2930,11 @@
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
"dev": true
},
"hangul-js": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/hangul-js/-/hangul-js-0.2.6.tgz",
"integrity": "sha512-48axU8LgjCD30FEs66Xc04/8knxMwCMQw0f67l67rlttW7VXT3qRJgQeHmhiuGwWXGvSbk6YM0fhQlcjE1JFQA=="
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
......
......@@ -21,6 +21,7 @@
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.13.0",
"gifencoder": "^2.0.1",
"hangul-js": "^0.2.6",
"stream": "0.0.2"
}
}
......
import ComponentInterface from "./ComponentInterface"
import Color from "./Color"
import Hangul from "hangul-js"
class Text extends ComponentInterface {
constructor(fabricObj) {
super();
this.color = new Color(fabricObj.fill);
this.text = fabricObj.text;
this.text = {
plain:fabricObj.text,
splited:Hangul.disassemble(fabricObj.text)
};
this.position = {
top:fabricObj.top,
left:fabricObj.left
......