summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/font.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-18 22:37:53 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-18 22:37:53 +0000
commitcd30677dab443c79750b46c29c69e5b865f9240b (patch)
treefe0d91b955fc034d76297380f5a152d05531ee5d /ext/tk/lib/tk/font.rb
parent63fe6ca5a08c371bac75d5a40ad008b61d99c6b5 (diff)
* ext/tk/lib/tk/font.rb: remove dependency on Ruby's version (1.8 or 1.9).
* ext/tk/lib/tkextlib/ICONS/icons.rb: ditto. * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto. * ext/tk/lib/tk.rb: update RELEASE_DATE git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/font.rb')
-rw-r--r--ext/tk/lib/tk/font.rb27
1 files changed, 14 insertions, 13 deletions
diff --git a/ext/tk/lib/tk/font.rb b/ext/tk/lib/tk/font.rb
index 8e63558..f7ea973 100644
--- a/ext/tk/lib/tk/font.rb
+++ b/ext/tk/lib/tk/font.rb
@@ -488,6 +488,19 @@ class TkFont
create_compoundfont(ltn, knj, keys)
end
+ def initialize_copy(font)
+ unless font.kind_of?(TkFont)
+ fail TypeError, '"initialize_copy should take same class object'
+ end
+ if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ keys = {}
+ font.configinfo.each{|key,value| keys[key] = value }
+ initialize(font.latin_font_id, font.kanji_font_id, keys)
+ else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
+ initialize(font.latin_font_id, font.kanji_font_id, font.configinfo)
+ end
+ end
+
def _get_font_info_from_hash(font)
font = _symbolkey2str(font)
foundry = (info = font['foundry'] .to_s)? info: '*'
@@ -1184,24 +1197,12 @@ class TkFont
###################################
=begin
def dup
- src = self
- obj = super()
- obj.instance_eval{ initialize(src) }
- obj
- end
- def clone
- src = self
- obj = super()
- obj.instance_eval{ initialize(src) }
- obj
- end
-=end
- def dup
TkFont.new(self)
end
def clone
TkFont.new(self)
end
+=end
end
module TkFont::CoreMethods