Am Mittwoch, 19. Juli 2017 um 22:23:32, schrieb Kornel Benko <kor...@lyx.org>
> Am Mittwoch, 19. Juli 2017 um 19:48:49, schrieb Guenter Milde 
> <mi...@users.sf.net>
> > On 2017-07-19, Kornel Benko wrote:
> >
> > > [-- Type: text/plain, Encoding: 7bit --]
> >
> > > Am Mittwoch, 19. Juli 2017 um 15:00:16, schrieb Kornel Benko 
> > > <kor...@lyx.org>
> > >> So, maybe better we could omit \textcompwordmark in mono fonts.
> >
> > > This patch works for me. It uses vphantom{}, but only between '<<' and 
> > > '>>'.
> >
> > See my other post for alternatives solving the "missing character" error
> > with Unicode fonts for \textcompwordmark.
>
> I have read it. I understand the usage and I don’t insist on removing 
> textcompwordmark any longer.
>
> > If you insist on changing away from textcompwordmark, this should be limited
> > to TU, i.e. done in
> > bool Paragraph::Private::latexSpecialTU(char_type const c, otexstream & os,
> >
> >
> > Günter
>
> I don't insist. I would insist on removing textcompwordmark in mono fonts, 
> but did not see an easy way.

It turned out, it is easy. Output for desired ligatures with the attached patch 
is:
        "\\vphantom{}" if mono mono-fonts
        "\\textcompwordmark " else.

To disable ligature for '>>' and '<<' the output is "\\vphantom{}"

        Kornel
diff --git a/lib/doc/de/Additional.lyx b/lib/doc/de/Additional.lyx
index 5ccd07b..539aa6d 100644
--- a/lib/doc/de/Additional.lyx
+++ b/lib/doc/de/Additional.lyx
@@ -41,9 +41,9 @@ shapepar
 \language_package default
 \inputencoding auto
 \fontencoding global
-\font_roman "lmodern" "default"
-\font_sans "lmss" "default"
-\font_typewriter "lmtt" "default"
+\font_roman "lmodern" "DejaVu Serif [bitstream]"
+\font_sans "lmss" "DejaVu Sans [bitstream]"
+\font_typewriter "lmtt" "DejaVu Sans Mono [bitstream]"
 \font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 73157e6..622477b 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -1378,8 +1378,8 @@ bool Paragraph::Private::latexSpecialT1(char_type const c, otexstream & os,
 		// but we should avoid ligatures
 		if (i + 1 >= int(text_.size()) || text_[i + 1] != c)
 			return true;
-		os << "\\textcompwordmark" << termcmd;
-		column += 19;
+		os << "\\vphantom{}";
+		column += 16;
 		return true;
 	case '|':
 		os.put(c);
diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp
index bbf54cf..293541c 100644
--- a/src/insets/InsetSpecialChar.cpp
+++ b/src/insets/InsetSpecialChar.cpp
@@ -424,7 +424,15 @@ void InsetSpecialChar::latex(otexstream & os,
 		os << "\\LyXZeroWidthSpace" << termcmd;
 		break;
 	case LIGATURE_BREAK:
-		os << "\\textcompwordmark" << termcmd;
+		if (rp.local_font != 0) {
+			FontFamily ff = rp.local_font->fontInfo().family();
+			if (ff == TYPEWRITER_FAMILY)
+				os << "\\vphantom{}";
+			else
+				os << "\\textcompwordmark" << termcmd;
+		}
+		else
+			os << "\\textcompwordmark" << termcmd;
 		break;
 	case END_OF_SENTENCE:
 		os << "\\@.";

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to