summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/font.rb
diff options
context:
space:
mode:
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 8e63558cae..f7ea973a71 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