Sha256: 2401e208bb670107e87104b921b90f4b3bda23384acbc1a1eefa5574d30af609
Contents?: true
Size: 886 Bytes
Versions: 9
Compression:
Stored size: 886 Bytes
Contents
class Prawn::SVG::CSS class << self def parse_font_family_string(string) in_quote = nil in_escape = false current = nil fonts = [] string.chars.each do |char| if in_escape in_escape = false if current.nil? current = char fonts << current else current << char end elsif char == ',' && in_quote.nil? current = nil elsif char == in_quote in_quote = nil elsif in_quote.nil? && (char == '"' || char == "'") in_quote = char elsif char == '\\' in_escape = true elsif current.nil? if char.match(/\s/).nil? current = char fonts << current end else current << char end end fonts.map(&:rstrip) end end end
Version data entries
9 entries across 9 versions & 1 rubygems