]> git.lyx.org Git - features.git/commitdiff
platex fixes.
authorGünter Milde <milde@lyx.org>
Wed, 10 Apr 2019 22:31:48 +0000 (00:31 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 13:48:24 +0000 (15:48 +0200)
* Force unicodesymbols conversion for all *-platex input encodings,
* except some characters that work well in utf8.
* Use platex if document language is "japanese" and input encoding is "utf8".

lib/doc/ja/Intro.lyx
lib/examples/ja/Multilingual_Typesetting_%28platex%29.lyx
lib/examples/ja/Welcome.lyx
lib/unicodesymbols
src/BufferParams.cpp
src/Encoding.cpp

index ff5042eb0675ff7ffa047a917cb4a0668f2d28e7..f69e16c37ba8fa6c0b4c9b0713c0771aeeb6cea4 100644 (file)
@@ -58,9 +58,9 @@ End
 \language_package auto
 \inputencoding jis-platex
 \fontencoding global
-\font_roman "palatino" "default"
-\font_sans "helvet" "default"
-\font_typewriter "courier" "default"
+\font_roman "lmodern" "default"
+\font_sans "default" "default"
+\font_typewriter "default" "default"
 \font_math "auto" "auto"
 \font_default_family default
 \use_non_tex_fonts false
index 40bb2abe47bf16e8b7a661ae9e968e76526f83f3..212228bde084e4d8df500de2198483e3e4d7cebc 100644 (file)
@@ -9,7 +9,7 @@
 \maintain_unincluded_children false
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
+\inputencoding utf8
 \fontencoding auto
 \font_roman "lmodern" "default"
 \font_sans "default" "default"
@@ -104,19 +104,11 @@ Deutsch: Grüße aus Österreich!
 \end_layout
 
 \begin_layout Standard
-Greek and Cyrillic Unicode characters are too wide.
- With Document\SpecialChar menuseparator
-Settings\SpecialChar menuseparator
-Language\SpecialChar menuseparator
-Encoding 
-\begin_inset Quotes eld
-\end_inset
-
-Japanese (platex) (utf8)
-\begin_inset Quotes erd
-\end_inset
-
- they are converted to LaTeX macros, so that the output matches Latin letters:
+Some Japanese fonts contain Greek and Cyrillic characters, however they
+ are are considerabely wider than characters in Latin, Greek, and Cyrillic
+ TeX fonts.
+ Therefore, LyX converts them to LaTeX macros, so that the output matches
+ other non-Japanese text:
 \end_layout
 
 \begin_layout Quotation
@@ -132,8 +124,8 @@ Russisch: Привет с
 \end_layout
 
 \begin_layout Standard
-Text in other languages with correct language setting - works only for some
languages:
+Text in some other languages with correct language setting (not all languages
supported by LyX are compatible with pLaTeX):
 \end_layout
 
 \begin_layout Standard
index 21e5fa6c1b243bf2d2406e5d25a395d23dce0a0c..1355b39fb0a68447790eaaaac93ac137cfe95814 100644 (file)
@@ -9,7 +9,7 @@
 \maintain_unincluded_children false
 \language japanese
 \language_package auto
-\inputencoding utf8-platex
+\inputencoding utf8
 \fontencoding auto
 \font_roman "lmodern" "default"
 \font_sans "default" "default"
index 54959d6bf36a9d2db38dbd362a9d320ada0d7889..57dbf78e3186961012c52dd5aa3564986aa69fc6 100644 (file)
 #
 0x00a0 "~"                        "" "force=cp862;cp1255;cp1256;koi8-u;iso8859-6;iso8859-7,notermination=both" "~" "" # NO-BREAK SPACE
 0x00a1 "\\textexclamdown"         "" "force=cp862;cp1255;euc-jp;euc-kr" # INVERTED EXCLAMATION MARK
-0x00a2 "\\textcent"               "textcomp" "force=cp862;cp1255;cp1256;euc-jp;jis" #"\\mathcent" "txfonts|pxfonts" # CENT SIGN
-0x00a3 "\\pounds"                 "" "force=cp862;cp1255;cp1256;iso8859-7;euc-jp;jis" "\\pounds" "" # £ POUND SIGN
+0x00a2 "\\textcent"               "textcomp" "force=cp862;cp1255;cp1256;euc-jp;euc-jp-platex;jis;shift-jis-platex" #"\\mathcent" "txfonts|pxfonts" # CENT SIGN
+0x00a3 "\\pounds"                 "" "force=cp862;cp1255;cp1256;iso8859-7;euc-jp;euc-jp-platex;jis;shift-jis-platex" "\\pounds" "" # £ POUND SIGN
 0x00a4 "\\textcurrency"           "textcomp" "force=cp1256;euc-cn;euc-jp;euc-kr;gbk;iso8859-6" # CURRENCY SYMBOL
-0x00a5 "\\textyen"                "textcomp" "force=cp862;cp1255;cp1256;euc-jp;jis" "\\yen" "amssymb" # YEN SIGN
+0x00a5 "\\textyen"                "textcomp" "force=cp862;cp1255;cp1256;euc-jp;jis;shift-jis-platex" "\\yen" "amssymb" # YEN SIGN
 0x00a6 "\\textbrokenbar"          "textcomp" "force=cp1255;cp1256;iso8859-7;euc-jp" # BROKEN BAR
-0x00a7 "\\textsection"            "textcomp" "force=cp1255;cp1256;iso8859-7;euc-cn;euc-jp;euc-kr;euc-tw;gbk;jis" "\\mathsection" "" # SECTION SIGN
-0x00a8 "\\textasciidieresis"      "textcomp" "force=cp1255;cp1256;iso8859-7;euc-cn;euc-jp;euc-kr;gbk;jis" # DIAERESIS
+0x00a7 "\\textsection"            "textcomp" "force=cp1255;cp1256;iso8859-7;euc-cn;euc-jp;euc-kr;euc-tw;gbk;jis;shift-jis-platex" "\\mathsection" "" # SECTION SIGN
+0x00a8 "\\textasciidieresis"      "textcomp" "force=cp1255;cp1256;iso8859-7;euc-cn;euc-jp;euc-kr;gbk;jis;shift-jis-platex" # DIAERESIS
 0x00a9 "\\textcopyright"          "textcomp" "force=cp1255;cp1256;koi8-u;iso8859-7;euc-jp" # COPYRIGHT SIGN
 0x00aa "\\textordfeminine"        "textcomp" "force=cp862;euc-jp;euc-kr" # FEMININE ORDINAL INDICATOR
 0x00ab "\\guillemotleft"          "" "force=armscii8;cp862;cp1255;cp1256;iso8859-7" # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
 0x00ad "\\-"                      "" "force=cp1255;cp1256;iso8859-13;euc-jp;euc-kr;iso8859-6,notermination=text" "" "" # SOFT HYPHEN
 0x00ae "\\textregistered"         "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr" "\\circledR" "amssymb" # REGISTERED SIGN
 0x00af "\\textasciimacron"        "textcomp" "force=cp1255;cp1256;euc-jp" # MACRON
-0x00b0 "\\textdegree"             "textcomp" "force=cp862;cp1255;cp1256;koi8-u;iso8859-7;euc-cn;euc-jp;euc-kr;euc-tw;gbk;jis" "{^\\circ}" "" # DEGREE SIGN
+0x00b0 "\\textdegree"             "textcomp" "force=cp862;cp1255;cp1256;koi8-u;iso8859-7;euc-cn;euc-jp;euc-jp-platex;euc-kr;euc-tw;gbk;jis;shift-jis-platex" "{^\\circ}" "" # DEGREE SIGN
 0x00b1 "\\textpm"                 "textcomp" "force" "\\pm" "" # ± PLUS-MINUS SIGN
 0x00b2 "\\texttwosuperior"        "textcomp" "force" "{{}^2}" "" # ² SUPERSCRIPT TWO
 0x00b3 "\\textthreesuperior"      "textcomp" "force" "{{}^3}" "" # ³ SUPERSCRIPT THREE
-0x00b4 "\\textasciiacute"         "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr;jis" # ACUTE ACCENT
+0x00b4 "\\textasciiacute"         "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr;jis;shift-jis-platex" # ACUTE ACCENT
 0x00b5 "\\textmu"                 "textcomp" "force!=utf8;jis" "" "" # µ MICRO SIGN (upright, not $\mu$)
-0x00b6 "\\textparagraph"          "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr;jis" "\\mathparagraph" "" # PILCROW SIGN # not equal to \textpilcrow
+0x00b6 "\\textparagraph"          "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr;jis;shift-jis-platex" "\\mathparagraph" "" # PILCROW SIGN # not equal to \textpilcrow
 0x00b7 "\\textperiodcentered"     "" "force=cp862;cp1255;cp1256;koi8-u;iso8859-7;euc-kr;euc-tw;gbk" "\\cdot" "" # MIDDLE DOT
 0x00b8 "\\c{ }"                   "" "force=cp1255;cp1256;euc-jp;euc-kr" "" "" # CEDILLA
 0x00b9 "\\textonesuperior"        "textcomp" "force" "{{}^1}" "" # ¹ SUPERSCRIPT ONE
index 5704940ecd30413daf0a78b3a04c54668100a0ca..aee184cb006c0c15086ac8112a8088b53e00d7d9 100644 (file)
@@ -3435,6 +3435,8 @@ Encoding const & BufferParams::encoding() const
                return *(encodings.fromLyXName("utf8-plain"));
        if (inputenc == "auto" || inputenc == "default")
                return *language->encoding();
+       if (inputenc == "utf8" && language->lang() == "japanese")
+               return *(encodings.fromLyXName("utf8-platex"));
        Encoding const * const enc = encodings.fromLyXName(inputenc);
        if (enc)
                return *enc;
index 321744c16682dbb091f1df9b94496728bc4b1431..b3efc20f5789477d9eb02eb679c1ca1b8907eb88 100644 (file)
@@ -189,17 +189,18 @@ bool Encoding::encodable(char_type c) const
 {
        // assure the used encoding is properly initialized
        init();
-
        if (iconvName_ == "UTF-8" && package_ == none)
                return true;
        // platex does not load inputenc: force conversion of supported characters
-       if (name_ == "utf8-platex"
-           &&  c > 0x007f                 // Latin-1 Supplement
-               && (c < 0x05ff || c > 0x1d00)  // ... Hebrew + Phonetic Extensions
-               && (c < 0x2aff || c > 0xfb00)  // ... Supplemental Mathematical Operators + Alphabetic...
-               && (c < 0xfb4f || c > 0x1d400) // ...Presentation Forms + Mathematical...
-           &&  c < 0x1d7ff)                       // ...Alphanumeric Symbols
-               return false;  
+       if (package_ == Encoding::japanese
+           && ((0x7f < c && c <= 0x05ff) // Latin-1 Supplement ... Hebrew
+                       || (0x1d00 < c && c <= 0x218f) // Phonetic Extensions ... Number Forms
+                       || (0x2193 < c && c <= 0x2aff) // Arrows ... Supplemental Mathematical Operators
+                       || (0xfb00 < c && c <= 0xfb4f) // Alphabetic Presentation Forms
+                       || (0x1d400 < c && c <= 0x1d7ff)) // Mathematical Alphanumeric Symbols
+               && c != 0xa2 && c != 0xa3 && c != 0xa5 && c != 0xa7 // exceptions
+               && c != 0xa8 && c != 0xb0 && c != 0xb4 && c != 0xb6)  
+               return false;
        if (c < start_encodable_ && !isForced(c))
                return true;
        if (encodable_.find(c) != encodable_.end())