( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
$weight=$nameAssign[0]['text'];
$text_h_max=$nameAssign[0]['max_width']['desktop'];
$style=$nameAssign[0]['deformation']['font-style'];
$name=$nameAssign[0]['deformation']['font-family'];
$weight=$nameAssign[0]['static_styles']['font-weight']['desktop'];
$myfont = checkFontX($name,$weight,$style);
$font_Username=$nameAssign[0]['text'];
$font_Name=$nameAssign[0]['text'];
$font_Url=$nameAssign[0]['text'];
$font_Text=$nameAssign[0]['text'];
$textX_h_max=$nameAssign[0]['max_width']['desktop'];
$textX_w_max=$nameAssign[0]['max_width']['desktop'];
if (strpos($textX_w_max, 'px') !== false)
{$textX_w_max = str_replace("px","",$textX_w_max) ; }
if (strpos($textX_w_max, '%') !== false)
{$textX_w_max = str_replace("%","",$textX_w_max) ;
$row = getParamJSONTheme($themeid);
$params = json_decode("[".$nameAssign[0]['params']."]");
$widthX = $params[0]->width;
$textX_w_max = $widthX;
}
if (strpos($textX_h_max, '%') !== false )
{
$textX_h_max = str_replace("%","",$textX_h_max) ;
$row = getParamJSONTheme($themeid);
$params = json_decode("[".$nameAssign[0]['params']."]");
$heightX = $params[0]->height;
$textX_h_max = $heightX;
}
$textX_w="$textX_w_max";
$textX_h="$textX_h_max";
$textX_h=$nameAssign[0]['height'];
$textX_x=$nameAssign[0]['left']['desktop'];
$textX_y=$nameAssign[0]['top']['desktop'];
$textX_align=$nameAssign[0]['text-align']['desktop'];
if($textX_align == "inherit"){$textX_align ="left";}
$textX_size=$nameAssign[0]['static_styles']['font-size']['desktop']-4;
$textX_size=$textX_size;
$textX_color=$nameAssign[0]['static_styles']['color']['desktop'];
$url_color=$nameAssign[0]['static_styles']['color']['desktop'];
$name_color=$nameAssign[0]['static_styles']['color']['desktop'];
$username_color=$nameAssign[0]['static_styles']['color']['desktop'];
$url_size=$nameAssign[0]['static_styles']['font-size']['desktop'];
$name_size=$nameAssign[0]['static_styles']['font-size']['desktop'];
$username_size=$nameAssign[0]['static_styles']['font-size']['desktop'];
$textX_pad=$nameAssign[0]['static_styles']['padding']['desktop'][1];
$textX_pad=0;
$textX_line_height=$nameAssign[0]['static_styles']['line-height']['desktop'] ;
$layer_x=$nameAssign[0]['left']['desktop'];
$layer_y=$nameAssign[0]['top']['desktop'];
$layer_w=$nameAssign[0]['width'];
$layer_h=$nameAssign[0]['height'];
$layeropacity=$nameAssign[0]['deformation']['opacity'];
$layer_r=$nameAssign[0]['deformation']['xrotate'];
$angle = $nameAssign[0]['deformation']['xrotate'];
$underline=$nameAssign[0]['deformation']['text-decoration'];
if($underline == "underline"){$underline = 1;} else {$underline = 0;}
$font_Text = "assets/fonts/$myfont"; //font used
$type = "Caption";$column = "font";
$fontLayer = checkCustomFont($name);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text";
}
if (empty($customFont))
{
if(empty($myfont)) {
$myfont = "$name.ttf";
$fontPath = "assets/fonts/";
$font_Text ="$fontPath/$myfont";
}}
$backgroundWidth = $textX_w;
$backgroundHeight = 0;
$backgroundHeight = $textX_h;
$case=strtolower($nameAssign[0]['deformation']['text-transform']);
if($case=="uppercase")
{
$textX = strtoupper($textX);
}
if($case=="lowercase")
{
$textX = strtolower($textX);
}
if($case=="capitalize")
{
$textX = ucwords($textX);
}
if($case=="none")
{
$textX = $textX;
}
if (strpos($textX_w_max, 'auto') !== false || strpos($textX_h_max, 'auto') !== false)
{
$textX_size = "$textX_size";
$type_space = imagettfbbox($textX_size, 0, $font_Text, $textX);
// Determine image width and height, 10 pixels are added for 5 pixels padding:
$textX_w_max = abs($type_space[4] - $type_space[0]) + 40;
$textX_h_max = abs($type_space[5] - $type_space[1]) + 10;
$backgroundWidth = $textX_w_max;
$backgroundHeight = $textX_h_max;
}
/* exit("$textX"); */
WriteCaption($background,$textX_size,$textX_color,$textX_color,$textX_line_height,$textX_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$textX);