Coder Social home page Coder Social logo

Comments (4)

Udi-Fogiel avatar Udi-Fogiel commented on July 30, 2024

This following naive patch seems to work, but I did not think much about it:

diff --git a/babel.dtx b/babel.dtx
index ebfea61..859ddb9 100644
--- a/babel.dtx
+++ b/babel.dtx
@@ -23296,6 +23296,18 @@ local ranges = Babel.ranges
 
 local DIR = node.id('dir')
 local GLYPH = node.id('glyph')
+local tenln = font.id('tenln')
+local tenlnw = font.id('tenlnw')
+local tencirc = font.id('tencirc')
+local tencircw = font.id('tencircw')
+
+local function glyph_not_picture_font(node)
+	local id = node.id
+	if id ~= GLYPH then
+		return false
+	else
+		local font = node.font
+		return font ~= tenln and font ~= tenlnw
+			and font ~= tencirc and font ~= tencircw
+	end
+end
 
 local function insert_implicit(head, state, outer)
   local new_state = state
@@ -23384,7 +23396,7 @@ function Babel.bidi(head, ispar, hdir)
     -- current one is not added until we start processing the neutrals.
 
     -- three cases: glyph, dir, otherwise
-    if item.id == GLYPH
+    if glyph_not_picture_font(item)
        or (item.id == 7 and item.subtype == 2) then
 
       local d_font = nil
@@ -23513,7 +23525,7 @@ function Babel.bidi(head, ispar, hdir)
         temp = 'on'     -- W6
       end
       for e = first_et, #nodes do
-        if nodes[e][1].id == GLYPH then nodes[e][2] = temp end
+        if glyph_not_picture_font(nodes[e][1]) then nodes[e][2] = temp end
       end
       first_et = nil
       has_en = false
@@ -23553,7 +23565,7 @@ function Babel.bidi(head, ispar, hdir)
       temp = 'on'     -- W6
     end
     for e = first_et, #nodes do
-      if nodes[e][1].id == GLYPH then nodes[e][2] = temp end
+      if glyph_not_picture_font(nodes[e][1]) then nodes[e][2] = temp end
     end
   end
 
@@ -23589,7 +23601,7 @@ function Babel.bidi(head, ispar, hdir)
       for r = first_on, q - 1 do
         nodes[r][2] = temp
         item = nodes[r][1]    -- MIRRORING
-        if Babel.mirroring_enabled and item.id == GLYPH
+        if Babel.mirroring_enabled and glyph_not_picture_font(item)
              and temp == 'r' and characters[item.char] then
           local font_mode = ''
           if item.font > 0 and font.fonts[item.font].properties then

from babel.

jbezos avatar jbezos commented on July 30, 2024

@Udi-Fogiel Thanks. I'll try to take a look when I have a little time.

from babel.

jbezos avatar jbezos commented on July 30, 2024

@Udi-Fogiel After investigating, I realized \cancel doesn’t use the picture environment and builds the lines and vectors directly. Anyway, clearly mirroring must be disabled with ‘symbol’ fonts, and I’m even wondering if OML and OMS fonts should be included, too (or even U and OMX). For the moment, I’ll deal, following your suggestion, with the picture fonts.

from babel.

Udi-Fogiel avatar Udi-Fogiel commented on July 30, 2024

@jbezos

and I’m even wondering if OML and OMS fonts should be included, too (or even U and OMX). For the moment, I’ll deal, following your suggestion, with the picture fonts.

Maybe it will be useful to check for fonts with script=math as well? might help with the interaction between \hbox and equations.

from babel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.