From 015c5f064b14e4a79f151b46a6dd46b150520c81 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 29 Jan 2020 22:37:53 +0000 Subject: polyglossia (29jan20) git-svn-id: svn://tug.org/texlive/trunk@53592 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/polyglossia/gloss-hebrew.ldf | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf') diff --git a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf index 1f366a0f551..a21d5909cba 100644 --- a/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf +++ b/Master/texmf-dist/tex/latex/polyglossia/gloss-hebrew.ldf @@ -9,6 +9,7 @@ and may look very wrong.} \RequirePackage{hebrewcal} \PolyglossiaSetup{hebrew}{ + bcp47=he, script=Hebrew, direction=RL, scripttag=hebr, @@ -20,6 +21,9 @@ and may look very wrong.} %digits = hebrewnumber } +% BCP-47 compliant aliases +\setlanguagealias*{hebrew}{he} + \newif\if@calendar@hebrew \def\tmp@hebrew{hebrew} \define@key{hebrew}{calendar}[gregorian]{% @@ -50,6 +54,9 @@ and may look very wrong.} \setkeys{hebrew}{numerals} +% Register default options +\xpg@initialize@gloss@options{hebrew}{numerals=arabic,calendar=gregorian,marcheshvan=false} + \def\captionshebrew{% \def\prefacename{מבוא}% \def\refname{מקורות}% @@ -104,19 +111,45 @@ and may look very wrong.} \fi } +% Bidi inserts an RTL mark (0x200f) before any number, forcing numbers to +% RTL. Hebrew uses LTR numbers, though. So we insert an LTR mark to revert +% the directionality +\ifxetex + \newcommand\xpg@hebrew@DigitsDotDashInterCharToks{\if@nonlatin\char"200E \fi} +\fi + +\def\hebrew@ltr@numbers{% + \ifxetex + \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\xpg@hebrew@DigitsDotDashInterCharToks} + \fi% +} + +\def\nohebrew@ltr@numbers{% + \ifxetex + % This is bidi's original intervention + \XeTeXinterchartoks \bidi@sepmark@charclass \bidi@digits@charclass = {\DigitsDotDashInterCharToks} + \fi% +} + \def\hebrew@numbers{% \let\@alph\hebrewnumeral% \let\@Alph\Hebrewnumeral% + % Prevent bidi from setting the numbers RTL + \hebrew@ltr@numbers% } \def\nohebrew@numbers{% \let\@alph\latin@alph% \let\@Alph\latin@Alph% + % Restore previous bidi numbers definition + \nohebrew@ltr@numbers } \def\hebrew@globalnumbers{% \let\@arabic\hebrewnumber% \renewcommand\thefootnote{\localnumeral*{footnote}}% + % Prevent bidi from setting the numbers RTL + \hebrew@ltr@numbers% } % Store original definition -- cgit v1.2.3