LyXInitial pains: for now, fonts

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
jamshark70
Posts: 4
Joined: Thu Jan 15, 2026 9:22 am

Initial pains: for now, fonts

Post by jamshark70 »

I had been using emacs org-mode LaTeX export for writing documents, but it seems for a current project that I have outgrown this. So I was looking at LyX. I'm pretty sure it can handle what I need (maybe), but...

I like Charis SIL for body text. In my ~/.fonts directory, I have the four CharisSIL-B.ttf, CharisSIL-BI.ttf, CharisSIL-I.ttf and CharisSIL-R.ttf files.

In LyX, i've gone to document settings, selected "Use non-TeX fonts." Charis SIL does appear in the font menu, so clearly the font exists and is being recognized as such.

Then when I view the document, I get:
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
! Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric da
ta not found or bad.

! Font \TU/lmr/bx/n/10=[lmroman10-bold]:+tlig; at 10pt not loadable: metric data
not found or bad.
<to be read again>

! Package fontspec Error: The font "CharisSIL" cannot be found.

! Font \TU/CharisSIL(0)/m/n/10=CharisSIL:mode=node;language=dflt;+tlig; at 10pt
not loadable: metric data not found or bad.
<to be read again>
etc. etc.

Now the funny thing is, in my org-mode export setup I have:

#+LATEX_HEADER: \usepackage{fontspec}
#+LATEX_HEADER: \setmainfont[Ligatures={Common,TeX}]{CharisSIL}
#+LATEX_HEADER: \setmonofont{Inconsolata}

... and it works. So xelatex on my system has no problem with this font -- but LyX does.

At this point, I've spent the majority of a working day first fighting with an intractable problem with org-mode export, and now fighting with basic rendering in LyX. I would like to stay focused on solutions here, but it has been a frustrating day of not writing but rather beating my head against fruitless web searches.

(After resolving those, I will have a different problem to report, where side by side subframes are being rendered vertically rather than horizontally aligned as they are in the editor.)

hjh

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Re: Initial pains: for now, fonts

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

Are you sure that LyX is configured to use XeLaTeX? Because the default setting for LyX is pdfLaTeX (Document/Settings/Compiler), and that cannot use TTF fonts. On the other hand, you would get a fontspec error earlier because that cannot be used with pdfLaTeX at all. But check anyway, also to see if LyX is set to LuaLaTeX, which works with fontspec, but perhaps that engine doesn't find the font.

If LyX is also set to compile with XeLaTeX, then please make a small test document with that font, and add here as attachments:
  • the .lyx document
  • the LaTeX export document
  • the logfile of a LyX run
  • the logfile of a xelatex run
Perhaps we can see the cause then.

Stefan
LaTeX.org admin
jamshark70
Posts: 4
Joined: Thu Jan 15, 2026 9:22 am

Re: Initial pains: for now, fonts

Post by jamshark70 »

Stefan Kottwitz wrote: Thu Jan 15, 2026 12:38 pm Are you sure that LyX is configured to use XeLaTeX? Because the default setting for LyX is pdfLaTeX (Document/Settings/Compiler), and that cannot use TTF fonts. On the other hand, you would get a fontspec error earlier because that cannot be used with pdfLaTeX at all. But check anyway, also to see if LyX is set to LuaLaTeX, which works with fontspec, but perhaps that engine doesn't find the font.
Thanks.

i think the point of confusion for me was that default output format with TeX fonts is PDF while the default output format with non-TeX fonts is DVI. That is, a reasonable user expectation would be that flipping the non-TeX font switch should just enable the fonts and not also switch to a radically different output format.

"PDF (LuaTeX)" does work.

So this one is solved.

hjh
User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Re: Initial pains: for now, fonts

Post by Stefan Kottwitz »

Great! LuaTeX is often a better choice than XeTeX anyway, as the maintenance and future of XeTeX seem unclear.

Stefan
LaTeX.org admin
Post Reply