|
@@ -1,18 +1,18 @@
|
|
|
import { ShapePath } from './ShapePath.js';
|
|
|
|
|
|
-function Font( data ) {
|
|
|
+class Font {
|
|
|
|
|
|
- this.type = 'Font';
|
|
|
+ constructor( data ) {
|
|
|
|
|
|
- this.data = data;
|
|
|
+ Object.defineProperty( this, 'isFont', { value: true } );
|
|
|
|
|
|
-}
|
|
|
+ this.type = 'Font';
|
|
|
|
|
|
-Object.assign( Font.prototype, {
|
|
|
+ this.data = data;
|
|
|
|
|
|
- isFont: true,
|
|
|
+ }
|
|
|
|
|
|
- generateShapes: function ( text, size = 100 ) {
|
|
|
+ generateShapes( text, size = 100 ) {
|
|
|
|
|
|
const shapes = [];
|
|
|
const paths = createPaths( text, size, this.data );
|
|
@@ -27,7 +27,7 @@ Object.assign( Font.prototype, {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
+}
|
|
|
|
|
|
function createPaths( text, size, data ) {
|
|
|
|