module Prawn::Rtl::Connector
Public Class Methods
connect(string)
click to toggle source
# File lib/prawn/rtl/connector.rb, line 9 def self.connect(string) Prawn::Rtl::Connector::Logic.transform(string) end
fix_rtl(string)
click to toggle source
# File lib/prawn/rtl/connector.rb, line 13 def self.fix_rtl(string) return string unless include_rtl?(string) reorder(connect(string)) end
include_rtl?(string)
click to toggle source
# File lib/prawn/rtl/connector.rb, line 25 def self.include_rtl?(string) TwitterCldr::Shared::Bidi .from_string(string) .types .include?(:R) end
reorder(string)
click to toggle source
# File lib/prawn/rtl/connector.rb, line 18 def self.reorder(string) TwitterCldr::Shared::Bidi .from_string(string, direction: :RTL) .reorder_visually! .to_s end