mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
CJKutf8 is only to be used with the dedicated utf8-cjk encoding
This commit is contained in:
parent
b9b9759776
commit
9982651fd6
@ -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"
|
||||||
|
@ -3276,7 +3276,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
|
||||||
|
@ -307,7 +307,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());
|
||||||
@ -999,7 +999,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());
|
||||||
@ -1406,8 +1406,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());
|
||||||
@ -1605,7 +1607,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);
|
||||||
@ -1677,7 +1679,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