0

Can I get TeX (and particularly LuaTeX) issue an error when a font does not contain a glyph of the required type (roman, italic, etc.) for a character in the document being processed? A particular case of interest are fonts that lack glyphs for cyrillic letters (e.g.cmr10). Another case of interest are fonts (e.g. FreeSerif) that have their roman, italicized, bold and bold italicized types in separate files (and each type has to be loaded separately before it can be used).

9
  • Did you read the log file?
    – Sigur
    Commented May 26, 2014 at 13:53
  • 1
    We're trying to detect if a specific glyph is present in the font, or not, it might help you if this is your primary task, tex.stackexchange.com/questions/165665/…
    – Malipivo
    Commented May 26, 2014 at 13:59
  • 1
    Instead of complaining about TeX's "immaturity", it would be better if you could clarify what your question or problem is.
    – Sverre
    Commented May 26, 2014 at 15:26
  • 1
    @AngelTsankov Latex does not ignores it silently. It generates a warning. What happens is that those warnings are stored in a .log file, instead of being output in the screen. You can search for the text Font Warning in the .log for non-available families/shapes/series or the text Missing character for missing glyphs in a font.
    – JLDiaz
    Commented May 26, 2014 at 17:14
  • 1
    See tex.stackexchange.com/q/119883/7883
    – Thérèse
    Commented May 26, 2014 at 19:15

1 Answer 1

2

there is a report in the log file, of the form:

Missing character: There is no <char> in font <fontname>!

it isn't reported as an error, but it's easy enough to search for that message.

the report will be given only for glyphs/characters that are actually used in the input file.

pdflatex and xelatex will report missing glyphs; the mechanism is implemented deep in the innards of the *tex program, and it would probably not be a simple matter to convert this warning to a full error. however, it is not difficult to create a script to scan the log file for the message and produce a report.

i'm not a lualatex user, and i overlooked the fact that you are particularly interested in luatex. i just checked, and it seems that lualatex does not report missing glyphs. i would consider this a design flaw, and suggest that you submit a request for this feature to be provided. since luatex is following a somewhat different trajectory from the more "conventional" *tex implementations, it would be reasonable to suggest that the feature be implemented with a switch to specify whether the report should be a warning or an error. (not everyone wants the compilation to come to a screeching halt that would result from an error being reported.) the feature be added

2
  • What you are saying seems to be true for TeX but not for LuaTeX (or am I running too old a version---beta-0.70.2-2012062812). Anyway, my question is if it possible to get an error, not just a report?
    – SJU
    Commented May 26, 2014 at 18:58
  • @AngelTsankov -- sorry, i overlooked the fact that you are most interested in lualatex. i've tested this, and updated my answer. Commented May 26, 2014 at 20:33

Not the answer you're looking for? Browse other questions tagged .