2

Would you mind explaining to me why the following ConTeXt code does not work and how I can fix it?

\mainlanguage[ja]

\definefontfamily[mainface][serif][Heisei Mincho Std][tf=file:HeiseiMinStd-W3.otf, bf=file:HeiseiMinStd-W7.otf]

\setupbodyfont[mainface, serif, 11pt]
\definebodyfontenvironment[default][a=1.09, b=1.18, x=0.9, xx=0.89]

\starttext

渡辺 謙(わたなべ けん、1959年10月21日 - )は、日本の俳優。本名同じ。

\stoptext

After typesetting (TeXShop: ConTeXt (LuaTeX)), the result is a blank page. Thanks in advance.

  • 2
    Does ConTeXt find the font files? You can run the following example to test it: \starttext \doifelsefontpresent{HeiseiMinStd-W3}{YES}{NO} \stoptext – Wolfgang Schuster Jan 17 '16 at 16:13
  • Thanks for your help @Metafox . The command "\doifelsefontpresent{HeiseiMinStd-W3}{YES}{NO}" does absolutely nothing. I tried to replace the japanese text with a french text and it still does not work. The page I get is blank. – Arnaud Lasnier Jan 18 '16 at 10:17
  • You should have used the command in a document without any custom fonts. – Wolfgang Schuster Jan 18 '16 at 10:27
  • Now it works. The answer is YES. – Arnaud Lasnier Jan 18 '16 at 10:49
  • @ Metafox . Sorry I didn't tag you on my last comment. – Arnaud Lasnier Jan 18 '16 at 11:07
3

You can use your fonts with a short typescript for them.

\starttypescript [serif] [heisei]
    \setups[font:fallback:serif]
    \definefontsynonym [Serif]     [file:HeiseiMinStd-W3.otf]
    \definefontsynonym [SerifBold] [file:HeiseiMinStd-W7.otf]
\stoptypescript

\definetypeface [mainface] [rm] [serif] [heisei] [default] [features=default]
\definetypeface [mainface] [mm] [math]  [modern] [default]

\setupbodyfont[mainface,11pt]

\mainlanguage[ja]

\setscript[nihongo]

\starttext

渡辺 謙(わたなべ けん、1959年10月21日 - )は、日本の俳優。本名同じ。

\stoptext
  • Thank you so much for your help @Metafox. It works great now.Could you explain what went wrong in my code? I do not fully understand the difference between the \definefontfamily mechanism and the typescript/typeface mechanism. Thanks in advance. – Arnaud Lasnier Feb 1 '16 at 18:59

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.