1

When I compiling a file at LyX, I'd like to know which fonts's files it uses.
The reason I ask it, it because I have some problems with some of my fonts - I know their names of course but I'm not sure which files LyX uses....

The same thing happens to me at TeXWorks, so if someone knows how to get it from this - it will be also good!

The only thing I get from TeXWorks right know is:

LaTeX Font Warning: Font shape `TU/DavidCLM(0)/m/it' undefined
(Font)              using `TU/DavidCLM(0)/m/n' instead on input line 56.

Here is a MWE:

 % Preview source code

%% LyX 2.3.1-1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew]{article}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{%
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}

\setmainfont{DavidCLM-Medium.otf}[
BoldFont = DavidCLM-Bold.otf ,
ItalicFont = DavidCLM-MediumItalic.otf ,
BoldItalicFont = DavidCLM-BoldItalic.otf ]


\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}

\emph{שלום}
\end{document}

The font (not .otf and .ttf) can be download from here: http://www.ma.huji.ac.il/~sameti/tex/culmusmiktex.html
Direct link: http://www.ma.huji.ac.il/~sameti/tex/culmusmiktex0.2.2.zip

The ttf and the otf can be download from here:
https://sourceforge.net/projects/culmus/files/culmus/0.133/
(the 2nd file....)

Thank you!!

  • Which engine are you using ? XeTeX looks rather into system fonts and luatex into fonts shipped with your TeX distribution. Of course you can grab other fonts manually with fontspec but then you have to know where there files are. Btw, your warning tells you that you are trying to load italic fonts that are not available, but the regular one are used. So maybe your font does not have italic at all? – sztruks Nov 3 '18 at 14:21
  • @sztruks, for your first question: This is XeTeX, Version 3.14159265-2.6-0.99999 (MiKTeX 2.9.6840 64-bit) (preloaded format=xelatex 2018.11.2), for your second question: this is why it so weird! I have Italic font but it doesn't recognize it! – heblyx Nov 3 '18 at 14:52
  • Well, you should give your preamble as a MWE. I am not sure I can help you, but there are some who will. I understand you are sure that this italic shapes are in your Windows System Font file. – sztruks Nov 3 '18 at 15:16
  • @sztruks - I add MWE and sources for the fonts... – heblyx Nov 3 '18 at 15:24
1

I think I solved the problem.
I don't know which files LyX (or TeXWorks) use, but I solved the problem with the italic form:

This line: \newfontfamily\hebrewfont[Script=Hebrew]{David CLM} should be replace by those lines:

    setmainfont{DavidCLM-Medium.otf}[
    BoldFont = DavidCLM-Bold.otf ,
    ItalicFont = DavidCLM-MediumItalic.otf ,
    BoldItalicFont = DavidCLM-BoldItalic.otf ]

Maybe there is a problem because the names of the files (the Medium word), but I don't know the exactly reason for this. When I change it - I get the italic form. Here is MWE:

% Preview source code

%% LyX 2.3.1-1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,english,hebrew]{article}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\setmainfont{DavidCLM-Medium.otf}[
BoldFont = DavidCLM-Bold.otf ,
ItalicFont = DavidCLM-MediumItalic.otf ,
BoldItalicFont = DavidCLM-BoldItalic.otf ]
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\AtBeginDocument{
\renewcommand\footnoterule{%
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}

\emph{שלום}
\end{document}

enter image description here

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.