Jean-Marc Lasgouttes wrote:
> > What we could do is a bool Font::has_internal_fontenc() that checks for
> > the relevant languages. Is this what you have in mind?
>
> Yes, perhaps. My problem was to avoid sprinkling the code with explicit
> tests for language names.

Like the attached patch? I've put it directly into Languages.cpp.
In the long run, I'd rather read the info from the languages file instead of 
hardcoding a list of languages.

Jürgen
Index: src/Language.cpp
===================================================================
--- src/Language.cpp	(Revision 27652)
+++ src/Language.cpp	(Arbeitskopie)
@@ -57,7 +57,17 @@
 	return true;
 }
 
+bool Language::internalFontEncoding() const
+{
+	// FIXME: list incomplete
+	// FIXME: instead of hardcoding, this
+	// should go to the languages file
+	return lang_ == "hebrew"
+		|| lang_ == "greek"
+		|| lang_ == "polutonikogreek";
+}
 
+
 void Languages::read(FileName const & filename)
 {
 	Lexer lex;
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(Revision 27652)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -864,9 +864,15 @@
 		return;
 	}
 
-	if (lyxrc.fontenc == "T1" && latexSpecialT1(c, os, i, column))
+	// If T1 font encoding is used, use the special
+	// characters it provides.
+	// NOTE: some languages reset the font encoding
+	// internally
+	if (!running_font.language()->internalFontEncoding()
+	    && lyxrc.fontenc == "T1" && latexSpecialT1(c, os, i, column))
 		return;
 
+	// \tt font needs special treatment
 	if (running_font.fontInfo().family() == TYPEWRITER_FAMILY
 		&& latexSpecialTypewriter(c, os, i, column))
 		return;
Index: src/Language.h
===================================================================
--- src/Language.h	(Revision 27652)
+++ src/Language.h	(Arbeitskopie)
@@ -48,6 +48,8 @@
 	///
 	std::string const & latex_options() const { return latex_options_; }
 	///
+	bool internalFontEncoding() const;
+	///
 	bool read(Lexer & lex);
 private:
 	///

Reply via email to