                 }
                 
                 path = invisible.path(in: CGSize(width: glyphWidth, height: glyphHeight), isRTL: isRTL)
-                if invisible != .tab, invisible != .noBreakSpace, invisible != .otherSpaceSeparator {
-                    pathCache[invisible] = path
+                if invisible != .tab {
+                    pathCache[codeUnit] = path
                 }
             }
             

                    case .noBreakSpace:
                        // -> `boundingRect(forGlyphRange:in)` can occasionally not calculate the width of no-break space properly.
                        glyphWidth = self.textFont.width(of: "\u{00A0}")
                    default:
                        let glyphRange = NSRange(location: glyphIndex, length: 1)
                        let boundingRect = self.boundingRect(forGlyphRange: glyphRange, in: textContainer)

            let glyphIndex = self.glyphIndexForCharacter(at: charIndex)
            
            let path: CGPath
            if let cache = pathCache[codeUnit] {
                path = cache
            } else {
                let glyphWidth: CGFloat
