From 31c99e6b37c6108b346f43e3bd01742ad9ad36c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Fri, 22 Jun 2007 22:23:37 +0000 Subject: [PATCH] Fixes for Farsi: - Bufferparams.cpp: set correct font encoding for Farsi - lib/languages: define quotation marks for Farsi git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18858 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/languages | 3 ++- src/BufferParams.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/languages b/lib/languages index 13480116ed..0c0add715e 100644 --- a/lib/languages +++ b/lib/languages @@ -25,7 +25,8 @@ english english "English" false iso8859-15 en_US "" # Esperanto has no country code esperanto esperanto "Esperanto" false iso8859-3 eo "" estonian estonian "Estonian" false iso8859-15 et_EE "" -farsi farsi "Farsi" true utf8 fa_IR "" +# the definitions are only used due to bugs in the arabi-package - remove them if they become unnecessary! +farsi farsi "Farsi" true utf8 fa_IR "\DeclareTextSymbol{\guillemotright}{LFE}{62}\DeclareTextSymbol{\guillemotleft}{LFE}{60}" finnish finnish "Finnish" false iso8859-15 fi_FI "" # We redefine \og and \fg (guillemets) for older french language definitions french french "French" false iso8859-15 fr_FR "\addto\extrasfrench{\providecommand{\og}{\leavevmode\flqq~}\providecommand{\fg}{\ifdim\lastskip>\z@\unskip\fi~\frqq}}" diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index c96270cadb..a625dafaa9 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -892,8 +892,15 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, if (fontsDefaultFamily != "default") os << "\\renewcommand{\\familydefault}{\\" << from_ascii(fontsDefaultFamily) << "}\n"; + + // set font encoding // this one is not per buffer - if (lyxrc.fontenc != "default") { + // for Farsi we also need to load the LAE and LFE encoding + if (lyxrc.fontenc != "default" && language->lang() == "farsi") { + os << "\\usepackage[" << from_ascii(lyxrc.fontenc) + << ",LFE,LAE]{fontenc}\n"; + texrow.newline(); + } else { os << "\\usepackage[" << from_ascii(lyxrc.fontenc) << "]{fontenc}\n"; texrow.newline(); @@ -1144,7 +1151,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, lyxpreamble += from_utf8(features.getBabelOptions()); } - lyxpreamble += "\\makeatother\n"; + lyxpreamble += "\\makeatother\n\n"; int const nlines = int(lyx::count(lyxpreamble.begin(), lyxpreamble.end(), '\n'));