mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
CJKutf8 is only to be used with the dedicated utf8-cjk encoding
cherry-picked from 9982651fd6
This commit is contained in:
parent
434842563a
commit
e27870db7a
@ -9,7 +9,7 @@
|
|||||||
\maintain_unincluded_children false
|
\maintain_unincluded_children false
|
||||||
\language korean
|
\language korean
|
||||||
\language_package default
|
\language_package default
|
||||||
\inputencoding utf8
|
\inputencoding utf8-cjk
|
||||||
\fontencoding OT1
|
\fontencoding OT1
|
||||||
\font_roman "default" "NanumMyeongjo"
|
\font_roman "default" "NanumMyeongjo"
|
||||||
\font_sans "default" "NanumGothic"
|
\font_sans "default" "NanumGothic"
|
||||||
|
@ -3283,7 +3283,7 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
|
|||||||
// Load the CJK package if needed by a secondary language.
|
// Load the CJK package if needed by a secondary language.
|
||||||
// If the main encoding is some variant of UTF8, use CJKutf8.
|
// If the main encoding is some variant of UTF8, use CJKutf8.
|
||||||
if (encoding().package() != Encoding::CJK && features.mustProvide("CJK")) {
|
if (encoding().package() != Encoding::CJK && features.mustProvide("CJK")) {
|
||||||
if (encoding().iconvName() == "UTF-8"
|
if (language->encoding()->name() == "utf8-cjk"
|
||||||
&& LaTeXFeatures::isAvailable("CJKutf8"))
|
&& LaTeXFeatures::isAvailable("CJKutf8"))
|
||||||
os << "\\usepackage{CJKutf8}\n";
|
os << "\\usepackage{CJKutf8}\n";
|
||||||
else
|
else
|
||||||
|
@ -299,7 +299,7 @@ static TeXEnvironmentData prepareEnvironment(Buffer const & buf,
|
|||||||
if (data.par_language->encoding()->package() == Encoding::CJK &&
|
if (data.par_language->encoding()->package() == Encoding::CJK &&
|
||||||
state->open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
|
state->open_encoding_ != CJK && pit->isMultiLingual(bparams)) {
|
||||||
if (prev_par_language->encoding()->package() == Encoding::CJK) {
|
if (prev_par_language->encoding()->package() == Encoding::CJK) {
|
||||||
docstring const cjkenc = (bparams.encoding().iconvName() == "UTF-8"
|
docstring const cjkenc = (bparams.encoding().name() == "utf8-cjk"
|
||||||
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
||||||
from_ascii("UTF8")
|
from_ascii("UTF8")
|
||||||
: from_ascii(data.par_language->encoding()->latexName());
|
: from_ascii(data.par_language->encoding()->latexName());
|
||||||
@ -977,7 +977,7 @@ void TeXOnePar(Buffer const & buf,
|
|||||||
// context (nesting issue).
|
// context (nesting issue).
|
||||||
if (par_language->encoding()->package() == Encoding::CJK
|
if (par_language->encoding()->package() == Encoding::CJK
|
||||||
&& state->open_encoding_ != CJK && state->cjk_inherited_ == 0) {
|
&& state->open_encoding_ != CJK && state->cjk_inherited_ == 0) {
|
||||||
docstring const cjkenc = (bparams.encoding().iconvName() == "UTF-8"
|
docstring const cjkenc = (bparams.encoding().name() == "utf8-cjk"
|
||||||
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
||||||
from_ascii("UTF8")
|
from_ascii("UTF8")
|
||||||
: from_ascii(par_language->encoding()->latexName());
|
: from_ascii(par_language->encoding()->latexName());
|
||||||
@ -1384,8 +1384,10 @@ void latexParagraphs(Buffer const & buf,
|
|||||||
// (but not in child documents)
|
// (but not in child documents)
|
||||||
OutputState * state = getOutputState();
|
OutputState * state = getOutputState();
|
||||||
if (maintext && !is_child && !bparams.useNonTeXFonts
|
if (maintext && !is_child && !bparams.useNonTeXFonts
|
||||||
&& bparams.language->encoding()->package() == Encoding::CJK) {
|
&& bparams.language->encoding()->package() == Encoding::CJK
|
||||||
docstring const cjkenc = (bparams.encoding().iconvName() == "UTF-8"
|
&& (bparams.encoding().name() == "utf8-cjk"
|
||||||
|
|| bparams.encoding().iconvName() != "UTF-8")) {
|
||||||
|
docstring const cjkenc = (bparams.encoding().name() == "utf8-cjk"
|
||||||
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
||||||
from_ascii("UTF8")
|
from_ascii("UTF8")
|
||||||
: from_ascii(bparams.encoding().latexName());
|
: from_ascii(bparams.encoding().latexName());
|
||||||
@ -1583,7 +1585,7 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
|
|||||||
bool const from_to_cjk =
|
bool const from_to_cjk =
|
||||||
((oldEnc.package() == Encoding::CJK && newEnc.package() != Encoding::CJK)
|
((oldEnc.package() == Encoding::CJK && newEnc.package() != Encoding::CJK)
|
||||||
|| (oldEnc.package() != Encoding::CJK && newEnc.package() == Encoding::CJK))
|
|| (oldEnc.package() != Encoding::CJK && newEnc.package() == Encoding::CJK))
|
||||||
&& (bparams.inputenc != "utf8" && LaTeXFeatures::isAvailable("CJKutf8"));
|
&& (bparams.encoding().name() != "utf8-cjk" || !LaTeXFeatures::isAvailable("CJKutf8"));
|
||||||
if (!force && !from_to_cjk
|
if (!force && !from_to_cjk
|
||||||
&& ((bparams.inputenc != "auto" && bparams.inputenc != "default") || moving_arg))
|
&& ((bparams.inputenc != "auto" && bparams.inputenc != "default") || moving_arg))
|
||||||
return make_pair(false, 0);
|
return make_pair(false, 0);
|
||||||
@ -1655,7 +1657,7 @@ pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
|
|||||||
os << "\\egroup";
|
os << "\\egroup";
|
||||||
count += 7;
|
count += 7;
|
||||||
}
|
}
|
||||||
docstring const cjkenc = (bparams.encoding().iconvName() == "UTF-8"
|
docstring const cjkenc = (bparams.encoding().name() == "utf8-cjk"
|
||||||
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
&& LaTeXFeatures::isAvailable("CJKutf8")) ?
|
||||||
from_ascii("UTF8")
|
from_ascii("UTF8")
|
||||||
: from_ascii(bparams.encoding().latexName());
|
: from_ascii(bparams.encoding().latexName());
|
||||||
|
Loading…
Reference in New Issue
Block a user