class Fzeet::Windows::LOGFONT

Public Instance Methods

bold=(bold) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 29
def bold=(bold) self[:lfWeight] = (bold) ? 700 : 0 end
bold?() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 28
def bold?; self[:lfWeight] >= 700 end
face() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 22
def face; self[:lfFaceName].to_s end
face=(face) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 23
def face=(face) self[:lfFaceName] = face end
italic=(italic) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 32
def italic=(italic) self[:lfItalic] = (italic) ? 1 : 0 end
italic?() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 31
def italic?; self[:lfItalic] == 1 end
size() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 25
def size; -Rational(self[:lfHeight] * 72, Application.devcaps[:logpixelsy]) end
size=(size) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 26
def size=(size) self[:lfHeight] = -Windows.MulDiv((size * 10).to_i, Application.devcaps[:logpixelsy], 720) end
strikeout=(strikeout) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 38
def strikeout=(strikeout) self[:lfStrikeOut] = (strikeout) ? 1 : 0 end
strikeout?() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 37
def strikeout?; self[:lfStrikeOut] == 1 end
underline=(underline) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 35
def underline=(underline) self[:lfUnderline] = (underline) ? 1 : 0 end
underline?() click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 34
def underline?; self[:lfUnderline] == 1 end
update(from) click to toggle source
# File lib/fzeet/windows/gdi/Font.rb, line 40
def update(from)
        case from
        when PropertyStore
                from.each { |k, v|
                        case k
                        when UI_PKEY_FontProperties_Family; self.face = v.wstring
                        when UI_PKEY_FontProperties_Size; self.size = v.decimal.to_f
                        when UI_PKEY_FontProperties_Bold; self.bold = v.uint == 2
                        when UI_PKEY_FontProperties_Italic; self.italic = v.uint == 2
                        when UI_PKEY_FontProperties_Underline; self.underline = v.uint == 2
                        when UI_PKEY_FontProperties_Strikethrough; self.strikeout = v.uint == 2
                        end
                }
        else raise ArgumentError
        end

        self
end