Internal method to get the font sizes
@param array|bool $style Style for tags. Array with `maxFont` and
`minFont` keys or `false` to disable
@return array
@throws InvalidArgumentException
436802
protected function getFontSizes(array $style = [])
    {
        //Maximum and minimun font sizes we want to use
        $maxFont = empty($style['maxFont']) ? 40 : $style['maxFont'];
        $minFont = empty($style['minFont']) ? 12 : $style['minFont'];
        is_true_or_fail($maxFont > $minFont, __d('me_cms', 'Invalid values'), InvalidArgumentException::class);

        return [$maxFont, $minFont];
    }
941846
static public function explodeStyles($styles)
    {
        $a = [];

        $s = explode(';', $styles);

        foreach ($s as $c) {
            if (empty($c)) continue;
            list($p, $v) = explode(':', $c);
            $a[$p] = $v;
        }

        return $a;
    }
746026
public function svgSetStyle($styles)
    {
        // init the PDF style
        $style = '';

        // Style : fill
        if ($styles['fill']) {
            $this->SetFillColorArray($styles['fill']);
            $style.= 'F';
        }

        // Style : stroke
        if ($styles['stroke'] && $styles['stroke-width']) {
            $this->SetDrawColorArray($styles['stroke']);
            $this->SetLineWidth($styles['stroke-width']);
            $style.= 'D';
        }

        // Style : opacity
        if ($styles['fill-opacity']) {
            $this->SetAlpha($styles['fill-opacity']);
        }

        return $style;
    }
553876
public function setStyle($style)
    {
        if ($style == null) {
            $this->style = new IdenticonStyle();
        } elseif ($style instanceof IdenticonStyle) {
            $this->style = $style;
        } elseif (is_array($style)) {
            $this->style = new IdenticonStyle($style);
        } else {
            throw new \InvalidArgumentException(
                "Invalid indenticon style was specified. ".
                "Allowed values are IdenticonStyle instances and associative ".
                "arrays containing IdenticonStyle options.");
        }
        
        return $this;
    }
434901
public static function get_styled_dashes( $style, /** Currently unused. @scrutinizer ignore-unused */ Settings $settings ) {
		if ( isset( self::$styles[ $style ] ) ) {
			return new Simple_Dashes(
				self::$styles[ $style ][ self::_PARENTHETICAL ],
				self::$styles[ $style ][ self::_PARENTHETICAL_SPACE ],
				self::$styles[ $style ][ self::_INTERVAL ],
				self::$styles[ $style ][ self::_INTERVAL_SPACE ]
			);
		}

		return null;
	}
494125
public function label($style = 'success')
    {
        return $this->unescape()->as(function ($value) use ($style) {
            if ($value instanceof Arrayable) {
                $value = $value->toArray();
            }

            return collect((array) $value)->map(function ($name) use ($style) {
                return "<span class='label label-{$style}'>$name</span>";
            })->implode('&nbsp;');
        });
    }
1264774
function get_font_height($font, $size) {
		if (!$font) {
			$fontFamily = $this->_pdf->getFontFamily();
			$fontStyle = $this->_pdf->getFontStyle();
		}
		else {
			$fontdata = $this->_get_font($font);
			$fontFamily = $fontdata['family'];
			$fontStyle = $fontdata['style'];
			$this->_pdf->SetFont($fontFamily, $fontStyle, $size, $font);
		}
		if (strpos($fontStyle, 'B') !== false) {
			$scale = self::FONT_HEIGHT_SCALE_BOLD;
		}
		else {
			$scale = self::FONT_HEIGHT_SCALE_NORMAL;
		}
		$result = $scale * $size;
		//Helpers::dompdf_debug("trace", "(". basename($font) .", $size): returns $result");
		return $result;
	}
137730
public function addStyle($style) {
        $style = trim($style);
        if ($style != '') {
            if (strpos($this->style, $style) === false) {
                $this->style .= " 
                $style ";
            }
        }
    }
1048258
public function registerStyle($style)
    {
        $registeredStyle = parent::registerStyle($style);
        $this->registerFill($registeredStyle);
        $this->registerBorder($registeredStyle);
        return $registeredStyle;
    }
446776
public static function getCalculatedSize($width, $height, $maxWidth, $maxHeight)
    {
        $widthDiffRatio = $maxWidth / $width;
        $heightDiffRatio = $maxHeight / $height;

        if ($widthDiffRatio <= $heightDiffRatio) {
            // resize based on width
            $newWidth = $maxWidth;
            $newHeight = $height * $widthDiffRatio;
        } else {
            // resize based on height
            $newWidth = $width * $heightDiffRatio;
            $newHeight = $maxHeight;
        }

        return [
            $newWidth,
            $newHeight,
        ];
    }
858279
public static function fromSizeAndStyle(int $size, string $style): self
    {
        $minimumSize = 1;

        if ($minimumSize > $size) {
            throw Exception\InvalidIndentSizeException::fromSizeAndMinimumSize(
                $size,
                $minimumSize
            );
        }

        $characters = [
            'space' => ' ',
            'tab' => "\t",
        ];

        if (!\array_key_exists($style, $characters)) {
            throw Exception\InvalidIndentStyleException::fromStyleAndAllowedStyles(
                $style,
                ...\array_keys($characters)
            );
        }

        $value = \str_repeat(
            $characters[$style],
            $size
        );

        return new self($value);
    }
519884
public function getStyleAttributeArray(): array
    {
        $value = $this->getAttribute('style')['value'];

        if ($value === null) {
            return [];
        }

        $value = explode(';', substr(trim($value), 0, -1));
        $result = [];
        foreach ($value as $attr) {
            $attr = explode(':', $attr);
            $result[$attr[0]] = $attr[1];
        }

        return $result;
    }
857624
public function style($styles)
    {
        if (is_string($styles)) {
            return $this->style([$styles]);
        }

        $styles = array_map(function ($style) {
            return 'box-'.$style;
        }, $styles);

        $this->class = $this->class.' '.implode(' ', $styles);

        return $this;
    }
1028168
def get_font_style_attributes(font)
      return [] unless font

      attributes = []
      attributes << ['sz', font[:_size]]      if ptrue?(font[:_size])
      attributes << ['b',  font[:_bold]]      if font[:_bold]
      attributes << ['i',  font[:_italic]]    if font[:_italic]
      attributes << ['u',  'sng']             if font[:_underline]

      # Turn off baseline when testing fonts that don't have it.
      if font[:_baseline] != -1
        attributes << ['baseline', font[:_baseline]]
      end
      attributes
    end
1310251
private static int getStyle(TextStyle style)
    {
        final int value;
        if (TextStyle.NORMAL == style)
        {
            value = Font.TRUETYPE_FONT;
        }
        else if (TextStyle.BOLD == style)
        {
            value = Font.BOLD;
        }
        else if (TextStyle.ITALIC == style)
        {
            value = Font.ITALIC;
        }
        else
        {
            throw new LionEngineException(style);
        }
        return value;
    }
699513
public function addCSSDeclaration($style){
		if(!isset($this->controller)){
			return false;
			}
		$this->controller->style[]=$style;
		return true;
		}
1113951
public function maxSize($maxWidth = null, $maxHeight = null) {
        $params = array();

        if ($maxWidth) {
            $params[] = 'width=' . (int) $maxWidth;
        }

        if ($maxHeight) {
            $params[] = 'height=' . (int) $maxHeight;
        }

        if (!$params) {
            throw new InvalidArgumentException('width and/or height must be specified');
        }

        return $this->addTransformation(sprintf('maxSize:%s', implode(',', $params)));
    }