1

Below CJK-contains code compiles without errors however with warnings.

\documentclass[a4paper, twoside]{ltjsarticle}

\usepackage{luatexja-fontspec}
\usepackage[abspath]{currfile}

\setmainjfont[
    Path          = \currfileabsdir,
    UprightFont   = fonts/HGS_Mincho/HGRMB.ttc,
    BoldFont      = fonts/HGS_Mincho/HGRME.ttc
]{HGS Mincho}

\setsansjfont[
    Path          = \currfileabsdir,
    UprightFont   = fonts/HGS_Gothic/HGRGM.ttc,
    BoldFont      = fonts/HGS_Gothic/HGRGE.ttc,
]{HGS Gothic}

\begin{document}    
    \section{フォント試験試験}  
    \begin{itemize}
        \item 主要フォント
            \begin{itemize}
                \item 漢あア
                \item \bfseries{漢あア}
            \end{itemize}
        \item ゴシックのフォント
            \begin{itemize}
                \item \sffamily{漢あア}
                \item \sffamily{\bfseries{漢あア}}
            \end{itemize}
    \end{itemize}
\end{document} 

The warning contents is:

LaTeX Font Warning: Font shape `JT3/mc/m/it' undefined
(Font)              using `JT3/mc/m/n' instead on input line 3745.

*************************************************
* fontspec warning: "script-not-exist"
* 
* Font 'fonts/HGS_Mincho/HGRMB.ttc' does not contain script 'CJK'.

I suppose, in LaTeX Font Warning: Font shape 'JT3/mc/m/it' undefined, JT3/mc/m/it refers to italic shape. Normally CJK has not italic font style, so I don't care if I can not use it. However, I need this warning do not disturb me. Off course, muffle all warnings is not allowed approach.

Font 'fonts/HGS_Mincho/HGRMB.ttc' does not contain script 'CJK'. is also requires an attention, however I cannot merge it in one question...

1

You can explicitly set the italic font and bold italic font to the same as the upright fonts. This will stop the warning.

\setmainjfont[
    Path           = \currfileabsdir,
    UprightFont    = fonts/HGS_Mincho/HGRMB.ttc,
    ItalicFont     = fonts/HGS_Mincho/HGRMB.ttc,
    BoldFont       = fonts/HGS_Mincho/HGRME.ttc
    BoldItalicFont = fonts/HGS_Mincho/HGRME.ttc
]{HGS Mincho}

\setsansjfont[
    Path           = \currfileabsdir,
    UprightFont    = fonts/HGS_Gothic/HGRGM.ttc,
    ItalicFont     = fonts/HGS_Gothic/HGRGM.ttc,
    BoldFont       = fonts/HGS_Gothic/HGRGE.ttc,
    BoldItalicFont = fonts/HGS_Gothic/HGRGE.ttc,
]{HGS Gothic}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.