Class: Fox::FXFontDesc

Inherits:
Object
  • Object
show all
Defined in:
lib/libGUIb16.rb,
lib/libGUIb14.rb

Instance Method Summary collapse

Instance Method Details

#from_s(s) ⇒ Object



261
262
263
264
265
266
267
268
269
270
271
# File 'lib/libGUIb16.rb', line 261

def from_s(s)
  a = s.split("|")
  self.face = a[0]
  self.size = a[1].to_i
  self.weight = a[2].to_i
  self.slant = a[3].to_i
  self.encoding = a[4].to_i
  self.setwidth = a[5].to_i
  self.flags = a[6].to_i
  self
end

#init(fd) ⇒ Object



273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/libGUIb16.rb', line 273

def init fd
  if fd.is_a? Fox::FXFontDesc
    self.face = fd.face
    self.size = fd.size
    self.weight = fd.weight
    self.slant = fd.slant
    self.encoding = fd.encoding
    self.setwidth = fd.setwidth
    self.flags = fd.flags
  elsif fd.is_a? String
    from_s fd
  end
end

#to_sObject



251
252
253
254
255
256
257
258
259
# File 'lib/libGUIb16.rb', line 251

def to_s
  [face,
    size,
    weight,
    slant,
    encoding,
    setwidth,
    flags].join("|")
end