Class: Ruby::Fillform::Text
- Inherits:
-
Field
- Object
- Field
- Ruby::Fillform::Text
show all
- Defined in:
- lib/ruby-fillform.rb
Instance Method Summary
collapse
Methods inherited from Field
#default_value, #description, #flags, #height, #initialize, #name, #rect, #value, #width, #x, #y
Instance Method Details
#align ⇒ Object
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/ruby-fillform.rb', line 64
def align
case deref(@dictionary[:Q]).to_i
when 0
:left
when 1
:center
when 2
:right
else
:left
end
end
|
#font_color ⇒ Object
103
104
105
106
|
# File 'lib/ruby-fillform.rb', line 103
def font_color
return "000013ec" unless deref(@dictionary[:DA])
Prawn::Graphics::Color.rgb2hex(deref(@dictionary[:DA]).split(" ")[0..2].collect { |e| e.to_f * 255 }).to_s
end
|
#font_size ⇒ Object
81
82
83
84
85
86
87
|
# File 'lib/ruby-fillform.rb', line 81
def font_size
unless deref(@dictionary[:DA]).nil?
deref(@dictionary[:DA]).split(" ")[5].to_f
else
12.0
end
end
|
#font_style ⇒ Object
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# File 'lib/ruby-fillform.rb', line 89
def font_style
return :normal unless deref(@dictionary[:DA])
style = case deref(@dictionary[:DA]).split(" ")[0].split(",").last.to_s.downcase
when "bold" then :bold
when "italic" then :italic
when "bold_italic" then :bold_italic
when "normal" then :normal
else
:normal
end
style
end
|
#max_length ⇒ Object
77
78
79
|
# File 'lib/ruby-fillform.rb', line 77
def max_length
deref(@dictionary[:MaxLen]).to_i
end
|
#type ⇒ Object
108
109
110
|
# File 'lib/ruby-fillform.rb', line 108
def type
:text
end
|