commit 5ba05b546b3a1b6ad9ec8bc618b3ac432e95de00
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sun Jul 23 18:41:06 2017 +0200

    Do not error on missing ZWNJ (ligature break) characters.
    
    Since TeXLive 2016, "fontspec" maps the ligature break command
    \textcompwordmark to the ZWNJ character (U+200C).
    This character is missing in many fonts (including the default: Latin
    Modern) which leads to "Missing character" warnings in the XeTeX/LuaTeX
    log file if a document using non-TeX fonts contains a ligature break.
    
    LyX reports missing characters as error since fixing #9610.
    In case of "invisible" characters, there is no data loss, in case of the
    ZWNJ the functionality is kept: ligatures are prevented also if the ZWNJ
    is missing in a font.
    
    Therefore, a missing ZWNJ is now treated similar to missing characters
    in "nullfont" (see [63f41711/lyxgit], bug #10394) and does not trigger
    an error.
    
    Fixes: #10727
    (cherry picked from commit a40868510d36ccdcf3c431cdee17f8204d4b258a)
---
 src/LaTeX.cpp |   17 ++++++++++++-----
 status.22x    |    3 +++
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 46dda96..f3465d1 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -911,11 +911,18 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                // Warning about missing glyph in selected font
                                // may be dataloss (bug 9610)
                                // but can be ignored for 'nullfont' (bug 
10394).
-                               retval |= LATEX_ERROR;
-                               terr.insertError(0,
-                                                from_local8bit("Missing 
glyphs!"),
-                                                from_local8bit(token),
-                                                child_name);
+                               // as well as for ZERO WIDTH NON-JOINER 
(0x200C) which is
+                               // missing in many fonts and output for 
ligature break (bug 10727).
+                               // Since this error only occurs with utf8 
output, we can safely assume
+                               // that the log file is utf8-encoded
+                               docstring const utoken = from_utf8(token);
+                               if (!contains(utoken, 0x200C)) {
+                                       retval |= LATEX_ERROR;
+                                       terr.insertError(0,
+                                                        from_ascii("Missing 
glyphs!"),
+                                                        utoken,
+                                                        child_name);
+                               }
                        }
                }
        }
diff --git a/status.22x b/status.22x
index 25416e1..9c1f2cc 100644
--- a/status.22x
+++ b/status.22x
@@ -49,6 +49,9 @@ What's new
 
 - Catch "! Incomplete \if[x]" LaTeX error (bug 10666).
 
+- Ignore LaTeX error on missing ZWNJ (ligature break) characters
+  (bug 10727).
+
 - Fix PDF output of clipped graphics with recent graphics package (bug 7910).
 
 - Catch xdvipdfmx driver error that breaks XeTeX compilation (bug 10076).

Reply via email to