// or package options
|| (rp.use_babel
&& LaTeXFeatures::isAvailableAtLeastFrom("babel", 2019, 4, 3)
- && (hasPackageOption("babel", "bidi-r")
- || hasPackageOption("babel", "bidi-l")
- || contains(options, "bidi-r")
- || contains(options, "bidi-l")))
+ && useNonTeXFonts)
)
&& rp.flavor == Flavor::XeTeX;
}
lang_opts += force_provide;
}
}
+ if (useNonTeXFonts && features.hasRTLLanguage()) {
+ if (!lang_opts.empty())
+ lang_opts += ", ";
+ if (features.runparams().flavor == Flavor::XeTeX) {
+ // main language RTL?
+ if (language->rightToLeft())
+ lang_opts += "bidi=bidi-r";
+ else
+ lang_opts += "bidi=bidi-l";
+ } else
+ lang_opts += "bidi=basic";
+ }
// The prefs may require the languages to
// be submitted to babel itself (not the class).
if ((langoptions || have_mods) && !lang_opts.empty())