Method: RBPDF#GetNumChars
- Defined in:
- lib/rbpdf.rb
#GetNumChars(s) ⇒ Object Also known as: get_num_chars
Returns the numbero of characters in a string.
- @param string :s
-
The input string.
- @return int
-
number of characters
- @access public
- @since 2.0.0001 (2008-01-07)
2593 2594 2595 2596 2597 2598 |
# File 'lib/rbpdf.rb', line 2593 def GetNumChars(s) if (@current_font['type'] == 'TrueTypeUnicode') or (@current_font['type'] == 'cidfont0') return UTF8StringToArray(s).length end return s.length end |