Class: Emfsvg::Font
- Inherits:
-
Object
- Object
- Emfsvg::Font
- Defined in:
- lib/emfsvg/device_context.rb
Overview
Font value object: minimal subset of LOGFONT for text rendering.
Constant Summary collapse
- DEFAULT_HEIGHT =
0
Instance Attribute Summary collapse
-
#charset ⇒ Object
readonly
Returns the value of attribute charset.
-
#escapement ⇒ Object
readonly
Returns the value of attribute escapement.
-
#face_name ⇒ Object
readonly
Returns the value of attribute face_name.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#italic ⇒ Object
readonly
Returns the value of attribute italic.
-
#strikeout ⇒ Object
readonly
Returns the value of attribute strikeout.
-
#underline ⇒ Object
readonly
Returns the value of attribute underline.
-
#weight ⇒ Object
readonly
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
- #bold? ⇒ Boolean
- #dup ⇒ Object
-
#initialize(face_name: nil, height: DEFAULT_HEIGHT, weight: 0, italic: false, underline: false, strikeout: false, escapement: 0, charset: 0) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(face_name: nil, height: DEFAULT_HEIGHT, weight: 0, italic: false, underline: false, strikeout: false, escapement: 0, charset: 0) ⇒ Font
Returns a new instance of Font.
211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/emfsvg/device_context.rb', line 211 def initialize(face_name: nil, height: DEFAULT_HEIGHT, weight: 0, italic: false, underline: false, strikeout: false, escapement: 0, charset: 0) @face_name = face_name @height = height @weight = weight @italic = italic @underline = underline @strikeout = strikeout @escapement = escapement @charset = charset end |
Instance Attribute Details
#charset ⇒ Object (readonly)
Returns the value of attribute charset.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def charset @charset end |
#escapement ⇒ Object (readonly)
Returns the value of attribute escapement.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def escapement @escapement end |
#face_name ⇒ Object (readonly)
Returns the value of attribute face_name.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def face_name @face_name end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def height @height end |
#italic ⇒ Object (readonly)
Returns the value of attribute italic.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def italic @italic end |
#strikeout ⇒ Object (readonly)
Returns the value of attribute strikeout.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def strikeout @strikeout end |
#underline ⇒ Object (readonly)
Returns the value of attribute underline.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def underline @underline end |
#weight ⇒ Object (readonly)
Returns the value of attribute weight.
224 225 226 |
# File 'lib/emfsvg/device_context.rb', line 224 def weight @weight end |
Class Method Details
.default ⇒ Object
226 227 228 |
# File 'lib/emfsvg/device_context.rb', line 226 def self.default new end |
Instance Method Details
#bold? ⇒ Boolean
230 231 232 |
# File 'lib/emfsvg/device_context.rb', line 230 def bold? weight >= 700 end |