From: Juergen Spitzmueller Date: Fri, 15 Mar 2019 10:23:53 +0000 (+0100) Subject: Do not force LTR with nameref and non-TeX fonts X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2470 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f0282ddff4ecfa3dc33eac2a2dbd9e0bf45b28a2;p=features.git Do not force LTR with nameref and non-TeX fonts Fixes: #11518 --- diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index c9fcd993d0..e8eecedde9 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -471,6 +471,14 @@ void InsetRef::validate(LaTeXFeatures & features) const features.require("nameref"); } +bool InsetRef::forceLTR() const +{ + // We force LTR for references. Namerefs are output in the scripts direction + // at least with fontspec/bidi, though (see #11518). + // FIXME: Re-Audit all other RTL cases. + return (getCmdName() != "nameref" || !buffer().masterParams().useNonTeXFonts); +} + InsetRef::type_info const InsetRef::types[] = { { "ref", N_("Standard"), N_("Ref: ")}, diff --git a/src/insets/InsetRef.h b/src/insets/InsetRef.h index 267b72e494..3e3e7b07d9 100644 --- a/src/insets/InsetRef.h +++ b/src/insets/InsetRef.h @@ -73,7 +73,7 @@ public: void addToToc(DocIterator const & di, bool output_active, UpdateType utype, TocBackend & backend) const; /// - bool forceLTR() const { return true; } + bool forceLTR() const; //@} /// \name Static public methods obligated for InsetCommand derived classes