( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
$style=$row[$index]['deformation']['font-style'];
$name=$row[$index]['deformation']['font-family'];
$weight=$row[$index]['static_styles']['font-weight']['desktop'];
$myfont = checkFontX($name,$weight,$style);
$font_Username=$row[$index]['text'];
$font_Name=$row[$index]['text'];
$font_Url=$row[$index]['text'];
$font_Text=$row[$index]['text'];
$textX_h_max=$row[$index]['max_width']['desktop'];
$textX_w_max=$row[$index]['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("[".$row[$index]['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("[".$row[$index]['params']."]");
$heightX = $params[0]->height;
$textX_h_max = $heightX;
}
$textX_w="$textX_w_max";
$textX_h="$textX_h_max";
$textX_h=$row[$index]['height'];
$textX_x=$row[$index]['left']['desktop'];
$textX_y=$row[$index]['top']['desktop'];
$textX_align=$row[$index]['text-align']['desktop'];
if($textX_align == "inherit"){$textX_align ="left";}
$textX_size=$row[$index]['static_styles']['font-size']['desktop']-4;
$textX_size=$textX_size;
$textX_color=$row[$index]['static_styles']['color']['desktop'];
$url_color=$row[$index]['static_styles']['color']['desktop'];
$name_color=$row[$index]['static_styles']['color']['desktop'];
$username_color=$row[$index]['static_styles']['color']['desktop'];
$url_size=$row[$index]['static_styles']['font-size']['desktop'];
$name_size=$row[$index]['static_styles']['font-size']['desktop'];
$username_size=$row[$index]['static_styles']['font-size']['desktop'];
$textX_pad=$row[$index]['static_styles']['padding']['desktop'][1];
$textX_pad=0;
$textX_line_height=$row[$index]['static_styles']['line-height']['desktop'] ;
$layer_x=$row[$index]['left']['desktop'];
$layer_y=$row[$index]['top']['desktop'];
$layer_w=$row[$index]['width'];
$layer_h=$row[$index]['height'];
$layeropacity=$row[$index]['deformation']['opacity'];
$layer_r=$row[$index]['deformation']['xrotate'];
$angle = $row[$index]['deformation']['xrotate'];
$underline=$row[$index]['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($row[$index]['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);