]> git.lyx.org Git - lyx.git/commitdiff
Fixes for Farsi:
authorUwe Stöhr <uwestoehr@web.de>
Fri, 22 Jun 2007 22:23:37 +0000 (22:23 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Fri, 22 Jun 2007 22:23:37 +0000 (22:23 +0000)
- 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
src/BufferParams.cpp

index 13480116edd991aed91f3dbf81d243def6f893d6..0c0add715ef78f95a3250e6c8168037da17219a7 100644 (file)
@@ -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}}"
index c96270cadbbb47d21c7b699802de126285a54566..a625dafaa9e11a1652c96b52ca7435628b2cbd29 100644 (file)
@@ -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'));