( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
$check = $type;
$rgbcolor = hexToRgb($color);
//$rgbcolor = $color;
if($check=="text" || $check=="i-text") {
$nameX="$face";
$type="name";
$fontName= checkFonteditor($nameX,$type);
if(!empty($fontName)){
$fontfamily = "$fontName";
$category = "sans serif";
$type = "google";
}
else
{
$randomfont = rand(1, 22);
if ($randomfont == 1) {
$fontfamily = "Trash Hand";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 2) {
$fontfamily = "VT323";
$category = "handwriting";
$type = "google";
}
if ($randomfont == 5) {
$fontfamily = "Permanent Marker";
$category = "serif";
$type = "google";
}
if ($randomfont == 6) {
$fontfamily = "Nixie One";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 7) {
$fontfamily = "Monoton";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 8) {
$fontfamily = "Molle Italic";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 9) {
$fontfamily = "Lobster Two";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 10) {
$fontfamily = "Kumar One Outline";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 11) {
$fontfamily = "Krona One";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 12) {
$fontfamily = "Fira Sans";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 13) {
$fontfamily = "Cody Star";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 14) {
$fontfamily = "Carter One";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 16) {
$fontfamily = "Bungee Inline";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 17) {
$fontfamily = "Corinthia Bold";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 18) {
$fontfamily = "Amatic SC";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 19) {
$fontfamily = "Aleo Bold";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 20) {
$fontfamily = "Fuzzy Bubbles";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 21) {
$fontfamily = "Roboto";
$category = "sans serif";
$type = "google";
}
if ($randomfont == 22) {
$fontfamily = "Fuzzy Bubbles";
$category = "sans serif";
$type = "google";
}
}
$name = str_replace("[", "", $name);
$name = str_replace("]", "", $name);
$name = str_replace("]", "", $name);
$x = $x;
$jsonv .= '{
"type": "i-text",
"version": "5.2.4",
"originX": "left",
"originY": "left",
"left": ' . $x . ',
"top": ' . $y . ',
"width": ' . $width . ',
"height": ' . $height . ',
"fill": "' . $rgbcolor . '",
"stroke": "#000",
"strokeWidth": 0.1,
"strokeDashArray": null,
"strokeLineCap": "butt",
"strokeDashOffset": 0,
"strokeLineJoin": "miter",
"strokeUniform": false,
"strokeMiterLimit": 4,
"scaleX": 1,
"scaleY": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"opacity": 1,
"shadow": null,
"visible": true,
"backgroundColor": null,
"fillRule": "nonzero",
"paintFirst": "fill",
"globalCompositeOperation": "source-over",
"skewX": 0,
"skewY": 0,
"fontFamily": "' . $fontfamily . '",
"fontWeight": 400,
"fontSize": ' . $size . ',
"text": "' . $name . '",
"underline": false,
"overline": false,
"linethrough": false,
"textAlign": "initial",
"fontStyle": "normal",
"lineHeight": 1.1,
"textBackgroundColor": "",
"charSpacing": 0,
"styles": [],
"direction": "ltr",
"path": null,
"pathStartOffset": 0,
"pathSide": "left",
"pathAlign": "baseline",
"selectable": true,
"evented": true,
"lockMovementX": false,
"lockMovementY": false,
"lockRotation": false,
"lockScalingX": false,
"lockScalingY": false,
"lockUniScaling": false,
"hasControls": true,
"hasBorders": true,
"hasRotatingPoint": true,
"name": "text",
"data": {
"id": "' . rand(111111, 911111) . '"
}
},';
}
if($check=="shape")
{
if($shapeType=="circle")
{
$typeS="circle";
}if($shapeType=="triangle")
{
$typeS="triangle";
include("shapes/triangle.php");
}
if($shapeType=="ellipse")
{
$typeS="ellipse";
include("shapes/ellipse.php");
}
if($shapeType=="square")
{
$typeS="rect";
include("shapes/rect.php");
}
if($shapeType=="rectangle")
{
$typeS="rect";
include("shapes/rect.php");
}
if($shapeType=="star")
{
$typeS="star";
include("shapes/star.php");
}
}
if($check=="imahge")
{
$image_urlV = "https://www.thebrand.ai/pages/splash/stock/buildbrand.png";
$jsonv .= ' {
"type": "image",
"version": "5.2.4",
"originX": "left",
"originY": "left",
"left": '.$x.',
"top": '.$y.',
"width": '.$width.',
"height": '.$height.',
"fill": "'.$rgbcolor.'",
"stroke": "#000",
"strokeWidth": 0,
"strokeDashArray": null,
"strokeLineCap": "butt",
"strokeDashOffset": 0,
"strokeLineJoin": "miter",
"strokeUniform": false,
"strokeMiterLimit": 4,
"scaleX": 1,
"scaleY": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"opacity": 1,
"shadow": null,
"visible": true,
"backgroundColor": null,
"fillRule": "nonzero",
"paintFirst": "fill",
"globalCompositeOperation": "source-over",
"skewX": 0,
"skewY": 0,
"cropX": 0,
"cropY": 0,
"selectable": true,
"evented": true,
"lockMovementX": true,
"lockMovementY": true,
"lockRotation": false,
"lockScalingX": true,
"lockScalingY": true,
"lockUniScaling": false,
"hasControls": true,
"hasBorders": true,
"hasRotatingPoint": true,
"crossOrigin": "anonymous",
"name": "image",
"data": {
"id": "'.rand(111111,911111).'"
},
"src": "'.$image_urlV.'",
"filters": []
}, ';
}