<?php

declare(strict_types=1);

namespace App\Framework\Svg\ValueObjects\Text;

/**
 * Value Object representing font family
 */
final readonly class FontFamily
{
    public function __construct(
        public string $value
    ) {
    }

    /**
     * Common system font stacks
     */
    public static function system(): self
    {
        return new self('system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif');
    }

    public static function sansSerif(): self
    {
        return new self('Arial, Helvetica, sans-serif');
    }

    public static function serif(): self
    {
        return new self('Georgia, "Times New Roman", serif');
    }

    public static function monospace(): self
    {
        return new self('"Courier New", Courier, monospace');
    }

    /**
     * Web-safe fonts
     */
    public static function arial(): self
    {
        return new self('Arial, sans-serif');
    }

    public static function helvetica(): self
    {
        return new self('Helvetica, Arial, sans-serif');
    }

    public static function verdana(): self
    {
        return new self('Verdana, Geneva, sans-serif');
    }

    public static function georgia(): self
    {
        return new self('Georgia, serif');
    }

    public static function timesNewRoman(): self
    {
        return new self('"Times New Roman", Times, serif');
    }

    /**
     * Convert to SVG attribute value
     */
    public function toSvgValue(): string
    {
        return $this->value;
    }

    public function __toString(): string
    {
        return $this->value;
    }
}
