//
//  CustomFont.swift
//  MyTatvaCare
//
//  Created by Nirav Ramani on 05/05/25.
//

import Foundation
import UIKit

class FontManager {

    enum FontWeight {
        case regular
        case medium
        case semibold
        case bold
    }

    static func font(ofSize size: CGFloat, weight: FontWeight = .regular) -> UIFont {
        switch weight {
        case .regular:
            return UIFont(name: "Roboto-Regular", size: size) ?? UIFont.systemFont(ofSize: size)
        case .medium:
            return UIFont(name: "Roboto-Medium", size: size) ?? UIFont.systemFont(ofSize: size, weight: .medium)
        case .semibold:
            return UIFont(name: "Roboto-Semibold", size: size) ?? UIFont.systemFont(ofSize: size, weight: .semibold)
        case .bold:
            return UIFont(name: "Roboto-Bold", size: size) ?? UIFont.systemFont(ofSize: size, weight: .bold)
        }
    }

    // Add common styles for convenience
    static var title: UIFont {
        return UIFont(name: "PlayfairDisplayRoman-Medium", size: 32) ?? UIFont.systemFont(ofSize: 32)
    }

    static var subtitle: UIFont {
       return UIFont(name: "PlayfairDisplayRoman-Medium", size: 24) ?? UIFont.systemFont(ofSize: 24)
    }

    static var body: UIFont {
        return font(ofSize: 16, weight: .regular)
    }

    static var caption: UIFont {
        return font(ofSize: 12, weight: .regular)
    }
}
