public $attachLeft = false;
public $allowsAnimation = true;
public $forceTexture = false;
+ public $letterspacing = 0;
protected $role = 'button';
$this->blendmode = $animation['blendmode'];
unset($animation['blendmode']);
}
+ if (isset($animation['letterspacing'])) {
+ $this->letterspacing = $animation['letterspacing'];
+ }
if (isset($animation['zindex'])) {
if ($animation['zindex'] >= 10) {
$this->zindex = $animation['zindex'];
$fz = $this->height * $this->getCssScale();
$fz = round($fz / $font['capHeight'], 2);
$res = parent::getCSS();
- $res .= 'line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
+ $res .= 'letter-spacing:' . $this->_css($this->letterspacing) . ';line-height:' . $font['capHeight'] . ';font-size:' . $fz . 'px;font-family:' . $font['family'] . ';color:' . wsHTML5::colorToCSS($this->extra, 1) . ';';
return $res;
}
+ protected function _css($v, $unit = "px")
+ {
+ if (!$v) {
+ return 0;
+ }
+ if (preg_match('/^([0-9\.\-]+)([a-z]*)$/', $v, $matches)) {
+ $v = $matches[1];
+ $unit = isset($matches[2]) && $matches[2] ? $matches[2] : $unit;
+ }
+ return $v . $unit;
+
+ }
+
public function getHTMLContainerClass()
{
return parent::getHTMLContainerClass() . ' textLink';