mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Factor out test for bidi package (= XeTeX + polyglossia)
This commit is contained in:
parent
1d0929b5d9
commit
04bd57a86a
@ -340,7 +340,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
|
|||||||
// the numbers are written Left-to-Right. ArabTeX package
|
// the numbers are written Left-to-Right. ArabTeX package
|
||||||
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
||||||
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
||||||
if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
|
if (!runparams.useBidiPackage()
|
||||||
&& !runparams.pass_thru
|
&& !runparams.pass_thru
|
||||||
&& bits_.number() == FONT_ON
|
&& bits_.number() == FONT_ON
|
||||||
&& prev.fontInfo().number() != FONT_ON
|
&& prev.fontInfo().number() != FONT_ON
|
||||||
@ -507,7 +507,7 @@ int Font::latexWriteEndChanges(otexstream & os, BufferParams const & bparams,
|
|||||||
// the numbers are written Left-to-Right. ArabTeX package
|
// the numbers are written Left-to-Right. ArabTeX package
|
||||||
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
// and bidi (polyglossia with XeTeX) reorder the number automatically
|
||||||
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
// but the packages used for Hebrew and Farsi (Arabi) do not.
|
||||||
if (!(runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX)
|
if (!runparams.useBidiPackage()
|
||||||
&& !runparams.pass_thru
|
&& !runparams.pass_thru
|
||||||
&& bits_.number() == FONT_ON
|
&& bits_.number() == FONT_ON
|
||||||
&& next.fontInfo().number() != FONT_ON
|
&& next.fontInfo().number() != FONT_ON
|
||||||
|
@ -57,7 +57,13 @@ bool OutputParams::isLaTeX() const
|
|||||||
|
|
||||||
bool OutputParams::isFullUnicode() const
|
bool OutputParams::isFullUnicode() const
|
||||||
{
|
{
|
||||||
return flavor == LUATEX|| flavor == DVILUATEX || flavor == XETEX;
|
return flavor == LUATEX || flavor == DVILUATEX || flavor == XETEX;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool OutputParams::useBidiPackage() const
|
||||||
|
{
|
||||||
|
return use_polyglossia && flavor == XETEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
@ -71,6 +71,8 @@ public:
|
|||||||
bool isLaTeX() const;
|
bool isLaTeX() const;
|
||||||
/// does this flavour support full unicode?
|
/// does this flavour support full unicode?
|
||||||
bool isFullUnicode() const;
|
bool isFullUnicode() const;
|
||||||
|
/// Do we use the bidi package (which does some reordering and stuff)?
|
||||||
|
bool useBidiPackage() const;
|
||||||
|
|
||||||
/// Same, but for math output, which only matter is XHTML output.
|
/// Same, but for math output, which only matter is XHTML output.
|
||||||
MathFlavor math_flavor;
|
MathFlavor math_flavor;
|
||||||
|
@ -1861,7 +1861,7 @@ char_type Paragraph::getUChar(BufferParams const & bparams,
|
|||||||
|
|
||||||
// Return unchanged character in LTR languages
|
// Return unchanged character in LTR languages
|
||||||
// or if we use poylglossia/bidi (XeTeX).
|
// or if we use poylglossia/bidi (XeTeX).
|
||||||
if ((rp.use_polyglossia && rp.flavor == OutputParams::XETEX)
|
if (rp.useBidiPackage()
|
||||||
|| !getFontSettings(bparams, pos).isRightToLeft())
|
|| !getFontSettings(bparams, pos).isRightToLeft())
|
||||||
return c;
|
return c;
|
||||||
|
|
||||||
@ -2249,7 +2249,7 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
|
|||||||
// RTL in classic (PDF)LaTeX (without the Bidi package)
|
// RTL in classic (PDF)LaTeX (without the Bidi package)
|
||||||
// Luabibdi (used by LuaTeX) behaves like classic
|
// Luabibdi (used by LuaTeX) behaves like classic
|
||||||
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
|
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
|
||||||
&& (!runparams.use_polyglossia || runparams.flavor != OutputParams::XETEX);
|
&& !runparams.useBidiPackage();
|
||||||
|
|
||||||
switch (curAlign) {
|
switch (curAlign) {
|
||||||
case LYX_ALIGN_NONE:
|
case LYX_ALIGN_NONE:
|
||||||
@ -2313,7 +2313,7 @@ bool Paragraph::Private::endTeXParParams(BufferParams const & bparams,
|
|||||||
// RTL in classic (PDF)LaTeX (without the Bidi package)
|
// RTL in classic (PDF)LaTeX (without the Bidi package)
|
||||||
// Luabibdi (used by LuaTeX) behaves like classic
|
// Luabibdi (used by LuaTeX) behaves like classic
|
||||||
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
|
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
|
||||||
&& (!runparams.use_polyglossia || runparams.flavor != OutputParams::XETEX);
|
&& !runparams.useBidiPackage();
|
||||||
|
|
||||||
switch (curAlign) {
|
switch (curAlign) {
|
||||||
case LYX_ALIGN_NONE:
|
case LYX_ALIGN_NONE:
|
||||||
|
@ -2934,7 +2934,7 @@ void Tabular::TeXRow(otexstream & os, row_type row,
|
|||||||
// Luabibdi (used by LuaTeX) behaves like classic
|
// Luabibdi (used by LuaTeX) behaves like classic
|
||||||
bool const bidi_rtl =
|
bool const bidi_rtl =
|
||||||
runparams.local_font->isRightToLeft()
|
runparams.local_font->isRightToLeft()
|
||||||
&& runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX;
|
&& runparams.useBidiPackage();
|
||||||
idx_type lastcell =
|
idx_type lastcell =
|
||||||
bidi_rtl ? getFirstCellInRow(row) : getLastCellInRow(row);
|
bidi_rtl ? getFirstCellInRow(row) : getLastCellInRow(row);
|
||||||
|
|
||||||
@ -3154,7 +3154,7 @@ void Tabular::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
// order for RTL (#9686). Thus we use this list.
|
// order for RTL (#9686). Thus we use this list.
|
||||||
bool const bidi_rtl =
|
bool const bidi_rtl =
|
||||||
runparams.local_font->isRightToLeft()
|
runparams.local_font->isRightToLeft()
|
||||||
&& runparams.use_polyglossia && runparams.flavor == OutputParams::XETEX;
|
&& runparams.useBidiPackage();
|
||||||
list<col_type> columns;
|
list<col_type> columns;
|
||||||
for (col_type cl = 0; cl < ncols(); ++cl) {
|
for (col_type cl = 0; cl < ncols(); ++cl) {
|
||||||
if (bidi_rtl)
|
if (bidi_rtl)
|
||||||
|
Loading…
Reference in New Issue
Block a user