José Matos wrote:
> > In fact, _all_ of them are covered by textcomp, so adding support will be
> > a breeze. And BTW, they were not supported until now anyway. That means,
> > you could enter them with latin1 encoding, but you got a LaTeX error
> > (unless you loaded textcomp manually).
>
>   Good to hear that. :-)

The attached patch adds support for those symbols in all encodings. I'll 
commit on monday if I get no objections.

Jürgen
Index: src/paragraph_pimpl.C
===================================================================
--- src/paragraph_pimpl.C	(Revision 16214)
+++ src/paragraph_pimpl.C	(Arbeitskopie)
@@ -669,6 +669,67 @@ void Paragraph::Pimpl::simpleTeXSpecialC
 			}
 			break;
 
+		// These characters are covered by latin1, but not
+		// by latin9 (a.o.). We have to support them because
+		// we switched the default of latin1-languages to latin9
+		case 0xa4:    // CURRENCY SYMBOL
+		case 0xa6:    // BROKEN BAR
+		case 0xa8:    // DIAERESIS
+		case 0xb4:    // ACUTE ACCENT
+		case 0xb8:    // CEDILLA
+		case 0xbd:    // 1/2 FRACTION
+		case 0xbc:    // 1/4 FRACTION
+		case 0xbe:    // 3/4 FRACTION
+		if ((bparams.inputenc == "latin1" ||
+			     bparams.inputenc == "latin5"||
+			     bparams.inputenc == "utf8") ||
+			    (bparams.inputenc == "auto" &&
+			     (font.language()->encoding()->latexName()
+			      == "latin1" ||
+			      font.language()->encoding()->latexName()
+			      == "latin5"||
+			      font.language()->encoding()->latexName()
+			      == "utf8"))) {
+				os.put(c);
+				break;
+			} else {
+				switch (c) {
+				case 0xa4:
+					os << "\\textcurrency{}";
+					column += 15;
+					break;
+				case 0xa6:
+					os << "\\textbrokenbar{}";
+					column += 16;
+					break;
+				case 0xa8:
+					os << "\\textasciidieresis{}";
+					column += 20;
+					break;
+				case 0xb4:
+					os << "\\textasciiacute{}";
+					column += 17;
+					break;
+				case 0xb8: // from latin1.def:
+					os << "\\c\\ ";
+					column += 3;
+					break;
+				case 0xbd:
+					os << "\\textonehalf{}";
+					column += 14;
+					break;
+				case 0xbc:
+					os << "\\textonequarter{}";
+					column += 17;
+					break;
+				case 0xbe:
+					os << "\\textthreequarters{}";
+					column += 20;
+					break;
+				}
+				break;
+			}
+
 		case '$': case '&':
 		case '%': case '#': case '{':
 		case '}': case '_':
@@ -819,8 +880,11 @@ void Paragraph::Pimpl::validate(LaTeXFea
 				break;
 			}
 		}
-		// the euro sign requires the textcomp package
-		if (getChar(i) == 0x20ac)
+		// these glyphs require the textcomp package
+		if (getChar(i) == 0x20ac || getChar(i) == 0xa4
+		    || getChar(i) == 0xa6 || getChar(i) == 0xa8
+		    || getChar(i) == 0xb4 || getChar(i) == 0xbd
+		    || getChar(i) == 0xbc || getChar(i) == 0xbe)
 			features.require("textcomp");
 	}
 }

Reply via email to