Module: Prawn::Rtl::Support::PrawnTextPatch
- Included in:
- Text::Formatted::Box
- Defined in:
- lib/prawn/rtl/support.rb
Overview
Patch module that intercepts Prawn’s text rendering to apply RTL transformations.
This module is prepended to Prawn::Text::Formatted::Box to automatically process RTL text before rendering. It intercepts the original_text method and applies Arabic letter connection and bidirectional text reordering to any text fragments that contain RTL characters.
Instance Method Summary collapse
-
#original_text ⇒ Array<Hash>
Overrides the original_text method to apply RTL transformations.
Instance Method Details
#original_text ⇒ Array<Hash>
Overrides the original_text method to apply RTL transformations.
27 28 29 30 31 32 |
# File 'lib/prawn/rtl/support.rb', line 27 def original_text super.map do |h| h[:text] = Prawn::Rtl::Connector.fix_rtl(h[:text]) if h.key?(:text) h end end |