diff --git a/img/contextmenu/btnFont.png b/img/contextmenu/btnFont.png
new file mode 100644
index 0000000..6cba1ab
Binary files /dev/null and b/img/contextmenu/btnFont.png differ
diff --git a/package-lock.json b/package-lock.json
index 11e8644..950584e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1932,6 +1932,11 @@
"isarray": "1.0.0"
}
},
+ "buffer-crc32": {
+ "version": "0.2.13",
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI="
+ },
"buffer-from": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-0.1.1.tgz",
@@ -4286,6 +4291,14 @@
}
}
},
+ "fd-slicer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
+ "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
+ "requires": {
+ "pend": "1.2.0"
+ }
+ },
"figures": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz",
@@ -5666,6 +5679,33 @@
"pinkie-promise": "2.0.1"
}
},
+ "google-fonts-webpack-plugin": {
+ "version": "0.4.4",
+ "resolved": "https://registry.npmjs.org/google-fonts-webpack-plugin/-/google-fonts-webpack-plugin-0.4.4.tgz",
+ "integrity": "sha512-+e2D9/DVBG9EDydRovzoqMZ658SsTBGbC0c65GyZqkwNvdj8vRSYQKXqbz7/yt7QaXsCPT1MpH45r3ivWOitcw==",
+ "requires": {
+ "lodash": "4.17.4",
+ "node-fetch": "1.7.3",
+ "webpack-sources": "0.2.3",
+ "yauzl": "2.9.1"
+ },
+ "dependencies": {
+ "source-list-map": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-1.1.2.tgz",
+ "integrity": "sha1-mIkBnRAkzOVc3AaUmDN+9hhqEaE="
+ },
+ "webpack-sources": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.2.3.tgz",
+ "integrity": "sha1-F8Yr+vE8cH+dAsR54Nzd6DgGl/s=",
+ "requires": {
+ "source-list-map": "1.1.2",
+ "source-map": "0.5.7"
+ }
+ }
+ }
+ },
"got": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/got/-/got-3.3.1.tgz",
@@ -10550,6 +10590,11 @@
"integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=",
"dev": true
},
+ "pend": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
+ },
"pepjs": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/pepjs/-/pepjs-0.4.3.tgz",
@@ -14364,6 +14409,15 @@
}
}
},
+ "yauzl": {
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.9.1.tgz",
+ "integrity": "sha1-qBmB6nCleUYTOIPwKcWCGok1mn8=",
+ "requires": {
+ "buffer-crc32": "0.2.13",
+ "fd-slicer": "1.0.1"
+ }
+ },
"yml-loader": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/yml-loader/-/yml-loader-2.1.0.tgz",
diff --git a/package.json b/package.json
index 6a2f517..c3076bd 100755
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
"blueimp-canvas-to-blob": "^3.14.0",
"bowser": "^1.8.1",
"fit-curve": "^0.1.6",
+ "google-fonts-webpack-plugin": "^0.4.4",
"imports-loader": "^0.7.1",
"jss": "^9.4.0",
"keycode": "^2.1.9",
diff --git a/src/actions/index.js b/src/actions/index.js
index d2eceab..64285fe 100644
--- a/src/actions/index.js
+++ b/src/actions/index.js
@@ -390,8 +390,8 @@ export function d2textInit(position, textId, screenMatrixContainer, screenMatrix
dispatch({ type: D2_TEXT_INIT, position, textId, screenMatrixContainer, screenMatrixZoom });
};
}
-export function d2textInputChange(text, family, weight, style, fill) {
- return { type: D2_TEXT_INPUT_CHANGE, text, family, weight, style, fill };
+export function d2textInputChange(text) {
+ return { type: D2_TEXT_INPUT_CHANGE, text };
}
const traceDragThrottle = createThrottle();
diff --git a/src/components/InputText.js b/src/components/InputText.js
index 9b31ab2..fe8528b 100644
--- a/src/components/InputText.js
+++ b/src/components/InputText.js
@@ -37,10 +37,9 @@ class InputText extends React.Component {
if (!shapeData) return;
const { changeText } = this.props;
- const { family, weight, style } = shapeData.text;
const text = this.refs.text.value;
- changeText(text, family, weight, style, true);
+ changeText(text);
};
getShapeData = () => {
@@ -71,7 +70,7 @@ class InputText extends React.Component {
>
0) {
component = (
);
+ } else if (FONT_TOOLS.includes(child.value)) {
+ component = (
+
+ );
} else {
component = (