\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{myfonts}[2025/04/05 My Fonts Configs]

\newif\if@japanese

\DeclareOption{japanese}{\@japanesetrue}
\DeclareOption{no-japanese}{\@japanesefalse}
\ExecuteOptions{japanese}
\ProcessOptions\relax

\if@japanese
    \usepackage{luatexja-fontspec}
    \usepackage{luatexja}
\else
    \usepackage{fontspec}
\fi
\usepackage[lutf8]{luainputenc}
\usepackage[T1]{fontenc}

\if@japanese
\setmainjfont{NotoSerifJP}[
    Path=../assets/fonts/,
    Extension=.ttf,
    YokoFeatures={JFM=jlreq},
    TateFeatures={JFM=jlreqv},
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Regular,
    ItalicFeatures={FakeSlant=0.33},
    BoldItalicFont=*-Regular,
    BoldItalicFeatures={FakeBold=2, FakeSlant=0.33}
]
\setsansjfont{NotoSansJP}[
    Path=../assets/fonts/,
    Extension=.ttf,
    YokoFeatures={JFM=jlreq},
    TateFeatures={JFM=jlreqv},
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Regular,
    ItalicFeatures={FakeSlant=0.33},
    BoldItalicFont=*-Regular,
    BoldItalicFeatures={FakeBold=2, FakeSlant=0.33}
]
\fi

\setmainfont{NotoSerif}[
    Path=../assets/fonts/,
    Extension=.ttf,
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Italic,
    BoldItalicFont=*-BoldItalic
]
\setsansfont{NotoSans}[
    Path=../assets/fonts/,
    Extension=.ttf,
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Italic,
    BoldItalicFont=*-BoldItalic
]

\newfontfamily{\fonthack}{Hack}[
    Path=../assets/fonts/,
    Extension=.ttf,
    UprightFont=*-Regular,
    BoldFont=*-Bold,
    ItalicFont=*-Italic,
    BoldItalicFont=*-BoldItalic
]

\renewcommand{\ttfamily}{\fonthack}
