platex fixes.

* 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".
This commit is contained in:
Günter Milde 2019-04-11 00:31:48 +02:00
parent 230cc9bc5b
commit f838b4fb18
6 changed files with 31 additions and 36 deletions

View File

@ -58,9 +58,9 @@ End
\language_package auto \language_package auto
\inputencoding jis-platex \inputencoding jis-platex
\fontencoding global \fontencoding global
\font_roman "palatino" "default" \font_roman "lmodern" "default"
\font_sans "helvet" "default" \font_sans "default" "default"
\font_typewriter "courier" "default" \font_typewriter "default" "default"
\font_math "auto" "auto" \font_math "auto" "auto"
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts false

View File

@ -9,7 +9,7 @@
\maintain_unincluded_children false \maintain_unincluded_children false
\language japanese \language japanese
\language_package auto \language_package auto
\inputencoding utf8-platex \inputencoding utf8
\fontencoding auto \fontencoding auto
\font_roman "lmodern" "default" \font_roman "lmodern" "default"
\font_sans "default" "default" \font_sans "default" "default"
@ -104,19 +104,11 @@ Deutsch: Grüße aus Österreich!
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
Greek and Cyrillic Unicode characters are too wide. Some Japanese fonts contain Greek and Cyrillic characters, however they
With Document\SpecialChar menuseparator are are considerabely wider than characters in Latin, Greek, and Cyrillic
Settings\SpecialChar menuseparator TeX fonts.
Language\SpecialChar menuseparator Therefore, LyX converts them to LaTeX macros, so that the output matches
Encoding other non-Japanese text:
\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:
\end_layout \end_layout
\begin_layout Quotation \begin_layout Quotation
@ -132,8 +124,8 @@ Russisch: Привет с
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
Text in other languages with correct language setting - works only for some Text in some other languages with correct language setting (not all languages
languages: supported by LyX are compatible with pLaTeX):
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard

View File

@ -9,7 +9,7 @@
\maintain_unincluded_children false \maintain_unincluded_children false
\language japanese \language japanese
\language_package auto \language_package auto
\inputencoding utf8-platex \inputencoding utf8
\fontencoding auto \fontencoding auto
\font_roman "lmodern" "default" \font_roman "lmodern" "default"
\font_sans "default" "default" \font_sans "default" "default"

View File

@ -60,13 +60,13 @@
# #
0x00a0 "~" "" "force=cp862;cp1255;cp1256;koi8-u;iso8859-6;iso8859-7,notermination=both" "~" "" # NO-BREAK SPACE 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 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 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;jis" "\\pounds" "" # £ POUND 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 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 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 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" # DIAERESIS 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 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 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 0x00ab "\\guillemotleft" "" "force=armscii8;cp862;cp1255;cp1256;iso8859-7" # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
@ -74,13 +74,13 @@
0x00ad "\\-" "" "force=cp1255;cp1256;iso8859-13;euc-jp;euc-kr;iso8859-6,notermination=text" "" "" # SOFT HYPHEN 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 0x00ae "\\textregistered" "textcomp" "force=cp1255;cp1256;euc-jp;euc-kr" "\\circledR" "amssymb" # REGISTERED SIGN
0x00af "\\textasciimacron" "textcomp" "force=cp1255;cp1256;euc-jp" # MACRON 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 0x00b1 "\\textpm" "textcomp" "force" "\\pm" "" # ± PLUS-MINUS SIGN
0x00b2 "\\texttwosuperior" "textcomp" "force" "{{}^2}" "" # ² SUPERSCRIPT TWO 0x00b2 "\\texttwosuperior" "textcomp" "force" "{{}^2}" "" # ² SUPERSCRIPT TWO
0x00b3 "\\textthreesuperior" "textcomp" "force" "{{}^3}" "" # ³ SUPERSCRIPT THREE 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$) 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 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 0x00b8 "\\c{ }" "" "force=cp1255;cp1256;euc-jp;euc-kr" "" "" # CEDILLA
0x00b9 "\\textonesuperior" "textcomp" "force" "{{}^1}" "" # ¹ SUPERSCRIPT ONE 0x00b9 "\\textonesuperior" "textcomp" "force" "{{}^1}" "" # ¹ SUPERSCRIPT ONE

View File

@ -3435,6 +3435,8 @@ Encoding const & BufferParams::encoding() const
return *(encodings.fromLyXName("utf8-plain")); return *(encodings.fromLyXName("utf8-plain"));
if (inputenc == "auto" || inputenc == "default") if (inputenc == "auto" || inputenc == "default")
return *language->encoding(); return *language->encoding();
if (inputenc == "utf8" && language->lang() == "japanese")
return *(encodings.fromLyXName("utf8-platex"));
Encoding const * const enc = encodings.fromLyXName(inputenc); Encoding const * const enc = encodings.fromLyXName(inputenc);
if (enc) if (enc)
return *enc; return *enc;

View File

@ -189,17 +189,18 @@ bool Encoding::encodable(char_type c) const
{ {
// assure the used encoding is properly initialized // assure the used encoding is properly initialized
init(); init();
if (iconvName_ == "UTF-8" && package_ == none) if (iconvName_ == "UTF-8" && package_ == none)
return true; return true;
// platex does not load inputenc: force conversion of supported characters // platex does not load inputenc: force conversion of supported characters
if (name_ == "utf8-platex" if (package_ == Encoding::japanese
&& c > 0x007f // Latin-1 Supplement && ((0x7f < c && c <= 0x05ff) // Latin-1 Supplement ... Hebrew
&& (c < 0x05ff || c > 0x1d00) // ... Hebrew + Phonetic Extensions || (0x1d00 < c && c <= 0x218f) // Phonetic Extensions ... Number Forms
&& (c < 0x2aff || c > 0xfb00) // ... Supplemental Mathematical Operators + Alphabetic... || (0x2193 < c && c <= 0x2aff) // Arrows ... Supplemental Mathematical Operators
&& (c < 0xfb4f || c > 0x1d400) // ...Presentation Forms + Mathematical... || (0xfb00 < c && c <= 0xfb4f) // Alphabetic Presentation Forms
&& c < 0x1d7ff) // ...Alphanumeric Symbols || (0x1d400 < c && c <= 0x1d7ff)) // Mathematical Alphanumeric Symbols
return false; && 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)) if (c < start_encodable_ && !isForced(c))
return true; return true;
if (encodable_.find(c) != encodable_.end()) if (encodable_.find(c) != encodable_.end())