From 346924c584789bc5469843b5f729e87b1d4b6923 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 22 May 2001 13:27:52 +0000 Subject: [PATCH] add iso8859-15 support git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2020 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 9 + lib/encodings | 26 +++ lib/examples/currency.lyx | 270 ++++++++++++++++++++++++++++ lib/kbd/european.kmap | 5 + lib/kbd/francais.kmap | 4 +- lib/kbd/iso8859-1.cdef | 32 ++-- lib/kbd/iso8859-15.cdef | 116 ++++++++++++ src/frontends/kde/ChangeLog | 4 + src/frontends/kde/docdlg.C | 1 + src/frontends/qt2/ChangeLog | 4 + src/frontends/qt2/FormDocument.C | 1 + src/frontends/xforms/ChangeLog | 4 + src/frontends/xforms/FormDocument.C | 2 +- 13 files changed, 460 insertions(+), 18 deletions(-) create mode 100644 lib/examples/currency.lyx create mode 100644 lib/kbd/iso8859-15.cdef diff --git a/lib/ChangeLog b/lib/ChangeLog index a1de6ecdf4..42cd54a53f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,12 @@ +2001-05-22 Adrien Rebollo + + * lib/kbd/european.kmap: + * lib/kbd/francais.kmap: + * lib/kbd/iso8859-15.cdef: + * encodings: add iso8859-15 support. + + * lib/kbd/iso8859-1.cdef: cleanup + 2001-05-22 Peter Suetterlin * templates/aa.lyx: rename from aapaper.lyx diff --git a/lib/encodings b/lib/encodings index c5783d3608..ef9d346991 100644 --- a/lib/encodings +++ b/lib/encodings @@ -186,6 +186,32 @@ Encoding iso8859-9 latin5 End +Encoding iso8859-15 latin9 + 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f + 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f + 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f + 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f + 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f + 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f + 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f + 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f + 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f + 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f + 00a0 00a1 00a2 00a3 20ac 00a5 0160 00a7 + 0161 00a9 00aa 00ab 00ac 00ad 00ae 00af + 00b0 00b1 00b2 00b3 017d 00b5 00b6 00b7 + 017e 00b9 00ba 00bb 0152 0153 0178 00bf + 00c0 00c1 00c2 00c3 00c4 00c5 00c6 00c7 + 00c8 00c9 00ca 00cb 00cc 00cd 00ce 00cf + 00d0 00d1 00d2 00d3 00d4 00d5 00d6 00d7 + 00d8 00d9 00da 00db 00dc 00dd 00de 00df + 00e0 00e1 00e2 00e3 00e4 00e5 00e6 00e7 + 00e8 00e9 00ea 00eb 00ec 00ed 00ee 00ef + 00f0 00f1 00f2 00f3 00f4 00f5 00f6 00f7 + 00f8 00f9 00fa 00fb 00fc 00fd 00fe 00ff +End + + Encoding cp1255 cp1255 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f diff --git a/lib/examples/currency.lyx b/lib/examples/currency.lyx new file mode 100644 index 0000000000..020eab2e10 --- /dev/null +++ b/lib/examples/currency.lyx @@ -0,0 +1,270 @@ +#LyX 1.1 created this file. For more info see http://www.lyx.org/ +\lyxformat 218 +\textclass article +\begin_preamble +\usepackage{eurofont} +\usepackage{wasysym} +\usepackage{amssymb} +\end_preamble +\language english +\inputencoding latin9 +\fontscheme default +\graphics default +\paperfontsize default +\spacing single +\papersize Default +\paperpackage a4 +\use_geometry 0 +\use_amsmath 0 +\paperorientation portrait +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\defskip medskip +\quotes_language english +\quotes_times 2 +\papercolumns 1 +\papersides 1 +\paperpagestyle default + +\layout Title + +Currency symbols and LyX +\layout Author + +by Adrien Rebollo +\layout Standard + +To obtain the main currency symbols with LaTeX, we need to use special packages. + Here we give a brief description of how to display and print the euro, + cent, yen and general currency symbols. + The dollar and the pound need no special trick, so we won't speak about + them. +\layout Section + +The euro symbol +\layout Standard + +To print the euro symbol, you need to get the eurofont package, available + at +\begin_inset LatexCommand \url{/macros/latex/contrib/supported/eurofont} + +\end_inset + + in the CTAN. + You'll need therefore to add to the LaTeX preamble of your LyX document + the command : +\family typewriter + +\backslash +usepackage{eurofont} +\family default +. + See the preamble of this document to figure out. + Then you obtain the euro symbol by typing +\family typewriter + +\backslash +euro{} +\family default + in TeX mode, like this : +\latex latex + +\backslash +euro{} +\latex default +. +\layout Standard + +There is another problem with the euro symbol : it is not included in the + latin1 character encoding. + So to have the glyph displayed on screen you should select iso8859-15 screen + fonts. + In the +\family sans +Edit\SpecialChar \menuseparator +Preferences +\family default + popup, you enter +\family typewriter +iso8859-15 +\family default + in the +\family sans +Screen\SpecialChar ~ +fonts\SpecialChar \menuseparator +Encoding +\family default + field, and of course you'll have to choose fonts that are available on + your system in this encoding. + You also need to choose an appropriate keymap file : +\family typewriter +european.kmap +\family default + and +\family typewriter +francais.kmap +\family default + should normally support the euro symbol at its usual place. + Select your keymap in the +\family sans +Language\SpecialChar \menuseparator +Keymap +\family default + fields. +\layout Standard + +The last step is to tell LyX that the encoding of your document is latin9. + You do this in the +\family sans +Format\SpecialChar \menuseparator +Document +\family default + popup. + It requires your LaTeX distribution to have the appropriate +\family typewriter +latin9.def +\family default + file for the +\family typewriter +inputenc +\family default + package. + It is in my tetex-1.0 distribution, and I have understood that it is provided + by the +\family typewriter +latex2html +\family default + program, which you can grab here : +\begin_inset LatexCommand \url{http://saftsack.fs.uni-bayreuth.de/~latex2ht/} + +\end_inset + +. +\layout Standard + +If you see an euro symbol here : ¤, and not some horrible glyph, that's + OK. + Now try to view the DVI file. + If LaTeX doesn't complain and the printed version seems fine, you're done. +\layout Section + +The cent symbol +\layout Standard + +The cent symbol is currently not available with LaTeX natively. + You need to have the package wasysym, which should be included in your + distribution. + You can get it at +\begin_inset LatexCommand \url{/macro/latex/contrib/supported/wasysym} + +\end_inset + + in the CTAN. + Then you insert the command : +\family typewriter + +\backslash +usepackage{wasysym} +\family default + in your LaTeX preamble. + If your keymap allows the direct display of the cent symbol, great, if + not you'll have to type +\family typewriter + +\backslash +cent{} +\family default + in TeX mode, like this : +\latex latex + +\backslash +cent{} +\latex default +. +\layout Section + +The yen symbol +\layout Standard + +For the yen, it is the same story as above, but with the package amssymb, + or amsfonts, available at +\begin_inset LatexCommand \url{/fonts/amsfonts} + +\end_inset + + in the CTAN, and typing +\family typewriter + +\backslash +yen{} +\family default +, like this : +\latex latex + +\backslash +yen{} +\latex default +. +\layout Section + +The general currency symbol +\layout Standard + +You know, it is the horrible little mix of cross and circle. + You cannot obtain it on screen together with the euro symbol, because it + is the latin1 character replaced by the euro in latin9. + But you can always obtain it by including the +\family typewriter +wasysym +\family default + package in the preamble, and by typing +\family typewriter + +\backslash +currency{} +\family default + in TeX mode : +\latex latex + +\backslash +currency{} +\latex default +. + +\layout Section + +The vertical broken bar +\layout Standard + +Of course it is not a currency symbol, but it is one that you can't obtain + with plain LaTeX, so let's tell something about it. + You must include the +\family typewriter +wasysym +\family default + package, and type +\family typewriter + +\backslash +brokenvert{} +\family default + in TeX mode : +\latex latex + +\backslash +brokenvert{} +\latex default +. +\layout Section + +Conclusion +\layout Standard + +Here we are, view the DVI, and complain to +\begin_inset LatexCommand \url{adrien.rebollo@gmx.fr} + +\end_inset + + if you run into problems. +\the_end diff --git a/lib/kbd/european.kmap b/lib/kbd/european.kmap index 0f6f92e8c1..636f350324 100644 --- a/lib/kbd/european.kmap +++ b/lib/kbd/european.kmap @@ -53,11 +53,16 @@ \kxmod umlaut s "\\ss{}" \kxmod umlaut S "\\ss{}" # +# french characters +# +\kmod ¬ "\\oe{}" +# # special characters # \kxmod umlaut $ "\\pounds{}" # pound \kxmod umlaut \# "\\S{}" # paragraph \kxmod umlaut ~ "\\b{}" # degree +\kmod ¤ "\\euro{}" # euro sign, to use with package eurofont # # \kxmod acute ' ' # \kxmod grave ` ` diff --git a/lib/kbd/francais.kmap b/lib/kbd/francais.kmap index 942e587224..6f28c6225b 100644 --- a/lib/kbd/francais.kmap +++ b/lib/kbd/francais.kmap @@ -2,9 +2,11 @@ # Key definition file for French national keyboard for LyX # -\kmap ¤ "\\oe{}" # {\oe} before u and i +\kmap ¬ "\\oe{}" # {\oe} before u and i \kmod ¨ umlaut aeiouAEIOU # umlaut on ¨ \kxmod umlaut i "\\\"{\\i}" # some exceptions \kmod ^ circumflex aeiouAEIOU # circumflex on ^ \kxmod circumflex i "\\^{\\i}" # some exceptions \kmod ² cedilla cC # cedilla on cC +\kmap ¤ "\\euro{}" # euro sign, to use with package eurofont + diff --git a/lib/kbd/iso8859-1.cdef b/lib/kbd/iso8859-1.cdef index 94565eed23..795b0bf404 100644 --- a/lib/kbd/iso8859-1.cdef +++ b/lib/kbd/iso8859-1.cdef @@ -6,38 +6,38 @@ # Any takers to complete the stuff? # -160 "\nobreakspace" -161 "\textexclamdown" -#162 "\textcent" +160 "\nobreakspace{}" +161 "\textexclamdown{}" +#162 "\textcent{}" 163 "\pounds{}" # pound sign -#164 "\textcurrency" -#165 "\textyen" -#166 "\textbrokenbar" +#164 "\textcurrency{}" +#165 "\textyen{}" +#166 "\textbrokenbar{}" 167 "\S{}" # paragraph 168 "\"{}" # umlaut 169 "\copyright{}" -170 "\textordfeminine" +170 "\textordfeminine{}" 171 "\guillemotleft{}" 172 "$\lnot$" 173 "\-{}" -174 "\textregistered" +174 "\textregistered{}" 175 "\={}" -176 "\textdegree" # circle +176 "\textdegree{}" # circle 177 "$\pm$" -178 "$\mathtwosuperios$" +178 "$\mathtwosuperior$" 179 "$\maththreesuperior$" 180 "\'{}" # acute 181 "$\mu$" # micro 182 "\P{}" -183 "$\cdot$" +183 "$\cdot$" # or \textperiodcentered 184 "\c{}" # cedilla 185 "$\mathonesuperior$" -186 "\textordmasculine" +186 "\textordmasculine{}" 187 "\guillemotright{}" -188 "\textonequarter" -189 "\textonehalf" -190 "\textthreequarters" # "0BE -191 "\textquestiondown" # mirrored ? +188 "\textonequarter{}" +189 "\textonehalf{}" +190 "\textthreequarters{}" # "0BE +191 "\textquestiondown{}" # mirrored ? 192 "\`{A}" 193 "\'{A}" 194 "\^{A}" diff --git a/lib/kbd/iso8859-15.cdef b/lib/kbd/iso8859-15.cdef new file mode 100644 index 0000000000..319db9017c --- /dev/null +++ b/lib/kbd/iso8859-15.cdef @@ -0,0 +1,116 @@ +# +# Character definition file for iso8859-15 character set +# Modified (c)2001 by Adrien Rebollo, adrien.rebollo@gmx.fr +# From : +# +# "Character definition file for iso8859-1 character set" +# +# (c)1996 by Ivan Schreter, schreter@ccsun.tuke.sk +# +# Any takers to complete the stuff? +# + +160 "\nobreakspace{}" +161 "\textexclamdown{}" +162 "\cent{}" # cent sign, to use with package wasysym +163 "\pounds{}" # pound sign +#164 "\textcurrency{}" +164 "\euro{}" # euro sign, to use with package eurofont +165 "\yen{}" # yen sign, to use with package amssymb +#166 "\textbrokenbar{}" +166 "\v{S}" +167 "\S{}" # paragraph +#168 "\"{}" # umlaut +168 "\v{s}" +169 "\copyright{}" +170 "\textordfeminine{}" +171 "\guillemotleft{}" +172 "$\lnot$" +173 "\-{}" +174 "\textregistered{}" +175 "\={}" +176 "\textdegree{}" # circle +177 "$\pm$" +178 "$\mathtwosuperios$" +179 "$\maththreesuperior$" +#180 "\'{}" # acute +180 "\v{Z}" +181 "$\mu$" # micro +182 "\P{}" +183 "$\cdot$" #{[ or \textperiodcentered +#184 "\c{}" # cedilla # or "\c\ " +184 "\v{z}" +185 "$\mathonesuperior$" +186 "\textordmasculine{}" +187 "\guillemotright{}" +#188 "\textonequarter{}" +188 "\OE{}" +#189 "\textonehalf{}" +189 "\oe{}" +#190 "\textthreequarters{}" # "0BE +190 "\"{Y}" +191 "\textquestiondown{}" # mirrored ? +192 "\`{A}" +193 "\'{A}" +194 "\^{A}" +195 "\~{A}" +196 "\"{A}" +197 "\AA{}" # A with circle # or "\r{A}" +198 "\AE{}" # AE cat'ed together +199 "\c{C}" # C cedilla +200 "\`{E}" +201 "\'{E}" +202 "\^{E}" +203 "\"{E}" +204 "\`{I}" +205 "\'{I}" +206 "\^{I}" +207 "\"{I}" +208 "\DH{}" +209 "\~{N}" +210 "\`{O}" +211 "\'{O}" +212 "\^{O}" +213 "\~{O}" +214 "\"{O}" +215 "$\times$" +216 "\O{}" +217 "\`{U}" +218 "\'{U}" +219 "\^{U}" +220 "\"{U}" +221 "\'{Y}" +222 "\TH{}" +223 "\ss{}" # German sharp S +224 "\`{a}" +225 "\'{a}" +226 "\^{a}" +227 "\~{a}" +228 "\"{a}" +229 "\aa{}" # a with circle # or "\r{a}" +230 "\ae{}" +231 "\c{c}" # c cedilla +232 "\`{e}" +233 "\'{e}" +234 "\^{e}" +235 "\"{e}" +236 "\`{\i}" +237 "\'{\i}" +238 "\^{\i}" +239 "\"{\i}" +240 "\dh{}" +241 "\~{n}" +242 "\`{o}" +243 "\'{o}" +244 "\^{o}" +245 "\~{o}" +246 "\"{o}" +247 "$\div$" +248 "\o{}" +249 "\`{u}" +250 "\'{u}" +251 "\^{u}" +252 "\"{u}" +253 "\'{y}" +254 "\th{}" +255 "\"{y}" diff --git a/src/frontends/kde/ChangeLog b/src/frontends/kde/ChangeLog index 7c55c45493..1f44e5f4c5 100644 --- a/src/frontends/kde/ChangeLog +++ b/src/frontends/kde/ChangeLog @@ -1,3 +1,7 @@ +2001-05-22 Adrien Rebollo + + * docdlg.C (DocDialog): add iso8859-15 support + 2001-05-09 Lars Gullik Bjønnes * FormParagraph.C: remove !NEW_INSETS and !NO_PEXTRA cruft diff --git a/src/frontends/kde/docdlg.C b/src/frontends/kde/docdlg.C index d928aa8b42..b54bb5c04e 100644 --- a/src/frontends/kde/docdlg.C +++ b/src/frontends/kde/docdlg.C @@ -146,6 +146,7 @@ DocDialog::DocDialog(FormDocument * form, QWidget * parent, char const * name, b language->combo_encoding->insertItem(_("latin1")); language->combo_encoding->insertItem(_("latin2")); language->combo_encoding->insertItem(_("latin5")); + language->combo_encoding->insertItem(_("latin9")); language->combo_encoding->insertItem(_("koi8-r")); language->combo_encoding->insertItem(_("koi8-u")); language->combo_encoding->insertItem(_("cp866")); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index fa99b1c3d3..90474fb677 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,7 @@ +2001-05-22 Adrien Rebollo + + * FormDocument.C (build): add iso8859-15 support. + 2001-05-17 Allan Rae * FormCharacter.C: diff --git a/src/frontends/qt2/FormDocument.C b/src/frontends/qt2/FormDocument.C index c42706faa0..98b675e52d 100644 --- a/src/frontends/qt2/FormDocument.C +++ b/src/frontends/qt2/FormDocument.C @@ -155,6 +155,7 @@ void FormDocument::build() dialog->inputEncCO->insertItem( _( "latin1" ) ); dialog->inputEncCO->insertItem( _( "latin2" ) ); dialog->inputEncCO->insertItem( _( "latin5" ) ); + dialog->inputEncCO->insertItem( _( "latin9" ) ); dialog->inputEncCO->insertItem( _( "koi8-r" ) ); dialog->inputEncCO->insertItem( _( "koi8-u" ) ); dialog->inputEncCO->insertItem( _( "cp866" ) ); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 1de1ed789d..df53486386 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-05-22 Adrien Rebollo + + * FormDocument.C (build): add iso8859-15 support. + 2001-05-08 Baruch Even * Menubar_pimpl.C: Fixed compilation problem. diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index b15857a504..161fe6578d 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -175,7 +175,7 @@ void FormDocument::build() // the document language form language_.reset(build_doc_language()); fl_addto_choice(language_->choice_inputenc, - "default|auto|latin1|latin2|latin5" + "default|auto|latin1|latin2|latin5|latin9" "|koi8-r|koi8-u|cp866|cp1251|iso88595"); // The language is a combo-box and has to be inserted manually