Class: TkFont (Ruby 2.2.4)
Description: Class : TkFont - Ruby 2.2.4

- Home
- Core 2.2.4
- Std-lib 2.2.4
- Downloads

Support for the Ruby 2.2 series has ended. See here for reference.

### Home Classes Methods

### In Files

- tk/lib/tk/font.rb
- tk/lib/tk/fontchooser.rb
- tk/lib/tkextlib/tile.rb

### Parent

Object

### Methods

- ::actual
- ::actual_displayof
- ::actual_hash
- ::actual_hash_displayof
- ::configinfo
- ::configure
- ::create_copy
- ::current_configinfo
- ::failsafe
- ::families
- ::get_obj
- ::init_widget_font
- ::is_system_font?
- ::measure
- ::measure_displayof
- ::metrics
- ::metrics_displayof
- ::metrics_hash
- ::metrics_hash_displayof
- ::names
- ::new
- ::used_on
- #[]
- #[]=
- #actual
- #actual_displayof
- #actual_hash
- #actual_hash_displayof
- #ascii_actual
- #ascii_actual_displayof
- #ascii_configinfo
- #ascii_configure
- #ascii_font
- #ascii_metrics
- #ascii_replace
- #asciifont
- #call_font_configure
- #configinfo
- #configure
- #create_asciifont
- #create_compoundfont
- #create_kanjifont
- #create_latinfont
- #current_configinfo
- #delete
- #font
- #font_id
- #id
- #inspect
- #kanji_actual
- #kanji_actual_displayof
- #kanji_actual_hash
- #kanji_actual_hash_displayof
- #kanji_configinfo
- #kanji_configure
- #kanji_current_configinfo
- #kanji_font
- #kanji_font_id
- #kanji_metrics
- #kanji_metrics_displayof
- #kanji_metrics_hash
- #kanji_metrics_hash_displayof
- #kanji_replace
- #kanjifont
- #latin_actual
- #latin_actual_displayof
- #latin_actual_hash
- #latin_actual_hash_displayof
- #latin_configinfo
- #latin_configure
- #latin_current_configinfo
- #latin_font
- #latin_font_id
- #latin_metrics
- #latin_metrics_displayof
- #latin_metrics_hash
- #latin_metrics_hash_displayof
- #latin_replace
- #latinfont
- #measure
- #measure_displayof
- #method_missing
- #metrics
- #metrics_displayof
- #metrics_hash
- #metrics_hash_displayof
- #mutex
- #name
- #replace
- #reset_pointadjust
- #to_eval
- #to_s
- #used

### Included Modules

- Tk
- TkFont::CoreMethods

### Class/Module Index

Quicksearch

- Arc
- Bitmap
- BitmapImage
- Checkbutton
- CloneMenu
- Font
- Grid
- INTERP
- Labelframe
- Line
- MenuButton
- MultiTkIp
- MultiTkIp::Command_Queue
- MultiTkIp::ThreadGroup
- MultiTkIp_OK
- MultiTkIp_PseudoToplevel_Evaluable
- Object
- Object::TkNamedVirtualEvent
- Object::TkSystemMenu
- Object::Ttk
- OptionMenuButton
- Oval
- Pack
- Panedwindow
- PhotoImage
- Place
- Polygon
- Radiobutton
- Rectangle
- RemoteTkIp
- Selection
- Spinbox
- TclTk
- TclTkCallback
- TclTkCommand
- TclTkImage
- TclTkInterpreter
- TclTkIp
- TclTkLib
- TclTkLib::EventFlag
- TclTkLib::RELEASE_TYPE
- TclTkLib::VarAccessFlag
- TclTkLibCommand
- TclTkObject
- TclTkVariable
- TclTkWidget
- TextItem
- Tk
- Tk::BLT
- Tk::BLT::Barchart
- Tk::BLT::Bitmap
- Tk::BLT::Busy
- Tk::BLT::Busy::Shield
- Tk::BLT::Container
- Tk::BLT::CutBuffer
- Tk::BLT::DnD
- Tk::BLT::DragDrop
- Tk::BLT::DragDrop::DnD_Handle
- Tk::BLT::DragDrop::PackageCommand
- Tk::BLT::DragDrop::PackageCommand::ValidateArgs
- Tk::BLT::DragDrop::SiteCommand
- Tk::BLT::DragDrop::SiteCommand::ValidateArgs
- Tk::BLT::DragDrop::Token
- Tk::BLT::EPS
- Tk::BLT::Graph
- Tk::BLT::GraphCommand
- Tk::BLT::Hiertable
- Tk::BLT::Htext
- Tk::BLT::PlotComponent
- Tk::BLT::PlotComponent::Axis
- Tk::BLT::PlotComponent::Bar
- Tk::BLT::PlotComponent::BitmapMarker
- Tk::BLT::PlotComponent::Crosshairs
- Tk::BLT::PlotComponent::Element
- Tk::BLT::PlotComponent::GridLine
- Tk::BLT::PlotComponent::ImageMarker
- Tk::BLT::PlotComponent::Legend
- Tk::BLT::PlotComponent::Line
- Tk::BLT::PlotComponent::LineMarker
- Tk::BLT::PlotComponent::Marker
- Tk::BLT::PlotComponent::OptKeys
- Tk::BLT::PlotComponent::Pen
- Tk::BLT::PlotComponent::PolygonMarker
- Tk::BLT::PlotComponent::Postscript
- Tk::BLT::PlotComponent::TextMarker
- Tk::BLT::PlotComponent::WindowMarker
- Tk::BLT::Printer
- Tk::BLT::Spline
- Tk::BLT::Stripchart
- Tk::BLT::Table
- Tk::BLT::Table::TableContainer
- Tk::BLT::Tabnotebook
- Tk::BLT::Tabnotebook::Tab
- Tk::BLT::Tabset
- Tk::BLT::Tabset::NamedTab
- Tk::BLT::Tabset::Tab
- Tk::BLT::Ted
- Tk::BLT::Tile
- Tk::BLT::Tile::Button
- Tk::BLT::Tile::CheckButton
- Tk::BLT::Tile::Checkbutton
- Tk::BLT::Tile::Frame
- Tk::BLT::Tile::Label
- Tk::BLT::Tile::RadioButton
- Tk::BLT::Tile::Radiobutton
- Tk::BLT::Tile::Scrollbar
- Tk::BLT::Tile::Toplevel
- Tk::BLT::Tree
- Tk::BLT::Tree::Node
- Tk::BLT::Tree::Notify
- Tk::BLT::Tree::Tag
- Tk::BLT::Tree::Trace
- Tk::BLT::Treeview
- Tk::BLT::Treeview::ConfigMethod
- Tk::BLT::Treeview::FindExecFlagValue
- Tk::BLT::Treeview::FindExecFlagValue::ValidateArgs
- Tk::BLT::Treeview::Node
- Tk::BLT::Treeview::OpenCloseCommand
- Tk::BLT::Treeview::OpenCloseCommand::ValidateArgs
- Tk::BLT::Treeview::Tag
- Tk::BLT::Treeview::TagOrID_Methods
- Tk::BLT::Vector
- Tk::BLT::VectorAccess
- Tk::BLT::Watch
- Tk::BLT::WinOp
- Tk::BLT::Winop
- Tk::BWidget
- Tk::BWidget::ArrowButton
- Tk::BWidget::Bitmap
- Tk::BWidget::Button
- Tk::BWidget::ButtonBox
- Tk::BWidget::ComboBox
- Tk::BWidget::Dialog
- Tk::BWidget::DragSite
- Tk::BWidget::DropSite
- Tk::BWidget::DynamicHelp
- Tk::BWidget::Entry
- Tk::BWidget::Label
- Tk::BWidget::LabelEntry
- Tk::BWidget::LabelFrame
- Tk::BWidget::ListBox
- Tk::BWidget::ListBox::Event_for_Items
- Tk::BWidget::ListBox::Item
- Tk::BWidget::MainFrame
- Tk::BWidget::MessageDlg
- Tk::BWidget::NoteBook
- Tk::BWidget::NoteBook::Event_for_Tabs
- Tk::BWidget::PagesManager
- Tk::BWidget::PanedWindow
- Tk::BWidget::PanelFrame
- Tk::BWidget::PasswdDlg
- Tk::BWidget::ProgressBar
- Tk::BWidget::ProgressDlg
- Tk::BWidget::ScrollView
- Tk::BWidget::ScrollableFrame
- Tk::BWidget::ScrolledWindow
- Tk::BWidget::SelectColor
- Tk::BWidget::SelectColor::Dialog
- Tk::BWidget::SelectColor::MenuButton
- Tk::BWidget::SelectColor::Menubutton
- Tk::BWidget::SelectFont
- Tk::BWidget::SelectFont::Dialog
- Tk::BWidget::SelectFont::Toolbar
- Tk::BWidget::Separator
- Tk::BWidget::SpinBox
- Tk::BWidget::StatusBar
- Tk::BWidget::TitleFrame
- Tk::BWidget::Tree
- Tk::BWidget::Tree::Event_for_Items
- Tk::BWidget::Tree::Node
- Tk::BWidget::Widget
- Tk::BinaryString
- Tk::Busy
- Tk::Button
- Tk::Canvas
- Tk::CheckButton
- Tk::Clock
- Tk::EncodedString
- Tk::Encoding
- Tk::Entry
- Tk::Frame
- Tk::HTML_Widget
- Tk::HTML_Widget::ClippingWindow
- Tk::ICONS
- Tk::Img
- Tk::Img::BMP
- Tk::Img::DTED
- Tk::Img::GIF
- Tk::Img::ICO
- Tk::Img::JPEG
- Tk::Img::PCX
- Tk::Img::PIXMAP
- Tk::Img::PNG
- Tk::Img::PPM
- Tk::Img::PS
- Tk::Img::Raw
- Tk::Img::SGI
- Tk::Img::SUN
- Tk::Img::TGA
- Tk::Img::TIFF
- Tk::Img::WINDOW
- Tk::Img::XBM
- Tk::Img::XPM
- Tk::Itcl
- Tk::Itcl::ItclObject
- Tk::ItemValidateConfigure
- Tk::Itk
- Tk::Itk::Archetype
- Tk::Itk::Component
- Tk::Itk::Toplevel
- Tk::Itk::Widget
- Tk::Iwidgets
- Tk::Iwidgets::Buttonbox
- Tk::Iwidgets::Calendar
- Tk::Iwidgets::Calendar::CalendarCommand
- Tk::Iwidgets::Calendar::CalendarCommand::ValidateArgs
- Tk::Iwidgets::Canvasprintbox
- Tk::Iwidgets::Canvasprintdialog
- Tk::Iwidgets::Checkbox
- Tk::Iwidgets::Combobox
- Tk::Iwidgets::Dateentry
- Tk::Iwidgets::Datefield
- Tk::Iwidgets::Dialog
- Tk::Iwidgets::Dialogshell
- Tk::Iwidgets::Disjointlistbox
- Tk::Iwidgets::Entryfield
- Tk::Iwidgets::Entryfield::EntryfieldValidate
- Tk::Iwidgets::Entryfield::EntryfieldValidate::ValidateArgs
- Tk::Iwidgets::Extbutton
- Tk::Iwidgets::Extfileselectionbox
- Tk::Iwidgets::Extfileselectiondialog
- Tk::Iwidgets::Feedback
- Tk::Iwidgets::Fileselectionbox
- Tk::Iwidgets::Fileselectiondialog
- Tk::Iwidgets::Finddialog
- Tk::Iwidgets::Hierarchy
- Tk::Iwidgets::Hierarchy::IconCommand
- Tk::Iwidgets::Hierarchy::IconCommand::ValidateArgs
- Tk::Iwidgets::Hierarchy::IndicatorCommand
- Tk::Iwidgets::Hierarchy::IndicatorCommand::ValidateArgs
- Tk::Iwidgets::Hierarchy::QueryCommand
- Tk::Iwidgets::Hierarchy::QueryCommand::ValidateArgs
- Tk::Iwidgets::Hyperhelp
- Tk::Iwidgets::Labeledframe
- Tk::Iwidgets::Labeledwidget
- Tk::Iwidgets::Mainwindow
- Tk::Iwidgets::Menubar
- Tk::Iwidgets::Messagebox
- Tk::Iwidgets::Messagedialog
- Tk::Iwidgets::Notebook
- Tk::Iwidgets::Optionmenu
- Tk::Iwidgets::Panedwindow
- Tk::Iwidgets::Promptdialog
- Tk::Iwidgets::Pushbutton
- Tk::Iwidgets::Radiobox
- Tk::Iwidgets::Scopedobject
- Tk::Iwidgets::Scrolledcanvas
- Tk::Iwidgets::Scrolledframe
- Tk::Iwidgets::Scrolledhtml
- Tk::Iwidgets::Scrolledlistbox
- Tk::Iwidgets::Scrolledtext
- Tk::Iwidgets::Scrolledwidget
- Tk::Iwidgets::Selectionbox
- Tk::Iwidgets::Selectiondialog
- Tk::Iwidgets::Shell
- Tk::Iwidgets::Spindate
- Tk::Iwidgets::Spinint
- Tk::Iwidgets::Spinner
- Tk::Iwidgets::Spinner::EntryfieldValidate
- Tk::Iwidgets::Spinner::EntryfieldValidate::ValidateArgs
- Tk::Iwidgets::Spintime
- Tk::Iwidgets::Tabnotebook
- Tk::Iwidgets::Tabset
- Tk::Iwidgets::Timeentry
- Tk::Iwidgets::Timefield
- Tk::Iwidgets::Toolbar
- Tk::Iwidgets::Watch
- Tk::Label
- Tk::LabelFrame
- Tk::Listbox
- Tk::Mac
- Tk::Mac::IconBitmap
- Tk::MacResource
- Tk::Menu
- Tk::Menu::TkInternalFunction
- Tk::MenuClone
- Tk::Menubutton
- Tk::Message
- Tk::OptionMenubutton
- Tk::OptionMenubutton::OptionMenu
- Tk::OptionObj
- Tk::PanedWindow
- Tk::RadioButton
- Tk::Root
- Tk::Scale
- Tk::Scrollable
- Tk::Scrollbar
- Tk::Spinbox
- Tk::Spinbox::SpinCommand
- Tk::Spinbox::SpinCommand::ValidateArgs
- Tk::SysMenu_Apple
- Tk::SysMenu_Help
- Tk::SysMenu_System
- Tk::SystemMenu
- Tk::TOPLEVEL_ALIASES
- Tk::TclX
- Tk::TclX::XPG3_MsgCat
- Tk::Tcllib
- Tk::Tcllib::Autoscroll
- Tk::Tcllib::CText
- Tk::Tcllib::ChatWidget
- Tk::Tcllib::Crosshair
- Tk::Tcllib::Cursor
- Tk::Tcllib::DateField
- Tk::Tcllib::Datefield
- Tk::Tcllib::Diagrams
- Tk::Tcllib::GetString_Dialog
- Tk::Tcllib::History
- Tk::Tcllib::ICO
- Tk::Tcllib::IP6_Entry
- Tk::Tcllib::IPEntry
- Tk::Tcllib::IPEntry6
- Tk::Tcllib::IP_Entry
- Tk::Tcllib::IP_Entry6
- Tk::Tcllib::KHIM
- Tk::Tcllib::KHIM::Help
- Tk::Tcllib::Ntext
- Tk::Tcllib::Plotchart
- Tk::Tcllib::Plotchart::Barchart
- Tk::Tcllib::Plotchart::Barchart3D
- Tk::Tcllib::Plotchart::Boxplot
- Tk::Tcllib::Plotchart::ChartMethod
- Tk::Tcllib::Plotchart::Ganttchart
- Tk::Tcllib::Plotchart::Histogram
- Tk::Tcllib::Plotchart::HorizontalBarchart
- Tk::Tcllib::Plotchart::IsometricPlot
- Tk::Tcllib::Plotchart::Isometricplot
- Tk::Tcllib::Plotchart::Piechart
- Tk::Tcllib::Plotchart::Plot3D
- Tk::Tcllib::Plotchart::PlotSeries
- Tk::Tcllib::Plotchart::PolarPlot
- Tk::Tcllib::Plotchart::Polarplot
- Tk::Tcllib::Plotchart::Radialchart
- Tk::Tcllib::Plotchart::RibbonChart3D
- Tk::Tcllib::Plotchart::RightAxis
- Tk::Tcllib::Plotchart::Stripchart
- Tk::Tcllib::Plotchart::TXPlot
- Tk::Tcllib::Plotchart::Timechart
- Tk::Tcllib::Plotchart::XLogYPlot
- Tk::Tcllib::Plotchart::XYPlot
- Tk::Tcllib::Style
- Tk::Tcllib::Swaplist_Dialog
- Tk::Tcllib::TableList
- Tk::Tcllib::TableList_Tile
- Tk::Tcllib::Tablelist
- Tk::Tcllib::TablelistItemConfig
- Tk::Tcllib::Tablelist_Tile
- Tk::Tcllib::Tkpiechart
- Tk::Tcllib::Tkpiechart::BoxLabeler
- Tk::Tcllib::Tkpiechart::ConfigMethod
- Tk::Tcllib::Tkpiechart::Label
- Tk::Tcllib::Tkpiechart::PeripheralLabeler
- Tk::Tcllib::Tkpiechart::Pie
- Tk::Tcllib::Tkpiechart::PieChartObj
- Tk::Tcllib::Tkpiechart::Slice
- Tk::Tcllib::Tooltip
- Tk::Tcllib::Validator
- Tk::Tcllib::Widget
- Tk::Tcllib::Widget::Calendar
- Tk::Tcllib::Widget::Canvas_Sqmap
- Tk::Tcllib::Widget::Canvas_Zoom
- Tk::Tcllib::Widget::DateEntry
- Tk::Tcllib::Widget::Dateentry
- Tk::Tcllib::Widget::Dialog
- Tk::Tcllib::Widget::MenuEntry
- Tk::Tcllib::Widget::Menuentry
- Tk::Tcllib::Widget::PanelFrame
- Tk::Tcllib::Widget::Panelframe
- Tk::Tcllib::Widget::Ruler
- Tk::Tcllib::Widget::ScreenRuler
- Tk::Tcllib::Widget::Screenruler
- Tk::Tcllib::Widget::ScrolledWindow
- Tk::Tcllib::Widget::Scrolledwindow
- Tk::Tcllib::Widget::Statusbar
- Tk::Tcllib::Widget::SuperFrame
- Tk::Tcllib::Widget::Toolbar
- Tk::Tcllib::Widget::ToolbarItem
- Tk::Tcllib::Widget::ToolbarItemConfig
- Tk::Text
- Tk::Text::IndexModMethods
- Tk::Text::IndexString
- Tk::Text::Peer
- Tk::Tile
- Tk::Tile::Button
- Tk::Tile::CheckButton
- Tk::Tile::Checkbutton
- Tk::Tile::Combobox
- Tk::Tile::Dialog
- Tk::Tile::Entry
- Tk::Tile::Font
- Tk::Tile::Frame
- Tk::Tile::KeyNav
- Tk::Tile::Label
- Tk::Tile::LabelFrame
- Tk::Tile::Labelframe
- Tk::Tile::MenuButton
- Tk::Tile::Menubutton
- Tk::Tile::Notebook
- Tk::Tile::ParseStyleLayout
- Tk::Tile::Progress
- Tk::Tile::Progressbar
- Tk::Tile::RadioButton
- Tk::Tile::Radiobutton
- Tk::Tile::Scale
- Tk::Tile::Scrollbar
- Tk::Tile::Separator
- Tk::Tile::SizeGrip
- Tk::Tile::Sizegrip
- Tk::Tile::Spinbox
- Tk::Tile::Square
- Tk::Tile::Style
- Tk::Tile::TButton
- Tk::Tile::TCheckButton
- Tk::Tile::TCheckbutton
- Tk::Tile::TCombobox
- Tk::Tile::TEntry
- Tk::Tile::TFrame
- Tk::Tile::TLabel
- Tk::Tile::TLabelFrame
- Tk::Tile::TLabelframe
- Tk::Tile::TMenuButton
- Tk::Tile::TMenubutton
- Tk::Tile::TNotebook
- Tk::Tile::TPaned
- Tk::Tile::TProgress
- Tk::Tile::TProgressbar
- Tk::Tile::TRadioButton
- Tk::Tile::TRadiobutton
- Tk::Tile::TScale
- Tk::Tile::TScrollbar
- Tk::Tile::TSeparator
- Tk::Tile::TSpinbox
- Tk::Tile::TSpinbox::SpinCommand
- Tk::Tile::TSpinbox::SpinCommand::ValidateArgs
- Tk::Tile::TSquare
- Tk::Tile::TileWidget
- Tk::Tile::Treeview
- Tk::Tile::Treeview::Item
- Tk::Tile::Treeview::Root
- Tk::Tile::Treeview::Tag
- Tk::Tile::TreeviewConfig
- Tk::Tile::XScrollbar
- Tk::Tile::YScrollbar
- Tk::TkDND
- Tk::TkDND::DND
- Tk::TkDND::DND_Subst
- Tk::TkDND::Shape
- Tk::TkSystemMenu
- Tk::TkTable
- Tk::TkTable::BrowseCommand
- Tk::TkTable::BrowseCommand::ValidateArgs
- Tk::TkTable::CellCommand
- Tk::TkTable::CellCommand::ValidateArgs
- Tk::TkTable::CellTag
- Tk::TkTable::ConfigMethod
- Tk::TkTable::NamedCellTag
- Tk::TkTable::SelectionCommand
- Tk::TkTable::SelectionCommand::ValidateArgs
- Tk::TkTable::ValidateCommand
- Tk::TkTable::ValidateCommand::ValidateArgs
- Tk::TkTrans
- Tk::Toplevel
- Tk::TreeCtrl
- Tk::TreeCtrl::BindCallback
- Tk::TreeCtrl::BitmapElement
- Tk::TreeCtrl::BorderElement
- Tk::TreeCtrl::Column
- Tk::TreeCtrl::ConfigMethod
- Tk::TreeCtrl::Element
- Tk::TreeCtrl::ImageElement
- Tk::TreeCtrl::Item
- Tk::TreeCtrl::NotifyEvent
- Tk::TreeCtrl::RectangleElement
- Tk::TreeCtrl::Style
- Tk::TreeCtrl_Widget
- Tk::Trofs
- Tk::Ttk
- Tk::UTF8_String
- Tk::ValidateConfigure
- Tk::Vu
- Tk::Vu::Bargraph
- Tk::Vu::ChartsConfig
- Tk::Vu::Dial
- Tk::Vu::NamedPieSlice
- Tk::Vu::Pie
- Tk::Vu::PieSlice
- Tk::Vu::PieSliceConfigMethod
- Tk::Vu::TkcBarchart
- Tk::Vu::TkcSticker
- Tk::Vu::TkcStripchart
- Tk::WinDDE
- Tk::WinRegistry
- Tk::Winico
- Tk::Winico::Winico_callback
- Tk::Winico::Winico_callback::ValidateArgs
- Tk::Wm
- Tk::Wm_for_General
- Tk::XScrollable
- Tk::XScrollbar
- Tk::X_Scrollable
- Tk::YScrollable
- Tk::YScrollbar
- Tk::Y_Scrollable
- TkAfter
- TkBgError
- TkBindCore
- TkBindTag
- TkBindTagAll
- TkBitmapImage
- TkCallbackBreak
- TkCallbackContinue
- TkCallbackEntry
- TkCallbackRedo
- TkCallbackRetry
- TkCallbackReturn
- TkCallbackThrow
- TkCanvasItemConfig
- TkClipboard
- TkComm
- TkComposite
- TkConfigMethod
- TkConsole
- TkCore
- TkCore::Tk_OBJECT_TABLE
- TkDatabaseClass
- TkDialog
- TkDialog2
- TkDialogObj
- TkEvent
- TkEvent::Event
- TkEvent::Event::Grp
- TkEvent::Event::StateMask
- TkEvent::Event::TypeNum
- TkFont
- TkFont::Chooser
- TkFont::CoreMethods
- TkFont::DescendantFont
- TkFont::Fontchooser
- TkGrid
- TkImage
- TkItemConfigMethod
- TkItemConfigOptkeys
- TkItemFontOptkeys
- TkKernel
- TkKinput
- TkListItemConfig
- TkLocalJumpError
- TkManageFocus
- TkMenuEntryConfig
- TkMenuSpec
- TkMenubar
- TkMsgCat
- TkMsgCatalog
- TkNamedFont
- TkNamespace
- TkNamespace::Ensemble
- TkNamespace::NsCode
- TkNamespace::ScopeArgs
- TkObject
- TkOption
- TkOptionDB
- TkOptionDB::Priority
- TkPack
- TkPackage
- TkPalette
- TkPhotoImage
- TkPixmapImage
- TkPlace
- TkRTTimer
- TkResourceDB
- TkScrollbox
- TkSelection
- TkTextImage
- TkTextMark
- TkTextMarkAnchor
- TkTextMarkCurrent
- TkTextMarkInsert
- TkTextNamedMark
- TkTextNamedTag
- TkTextTag
- TkTextTagConfig
- TkTextTagSel
- TkTextWin
- TkTextWindow
- TkTimer
- TkTreatFont
- TkTreatItemFont
- TkTreatTagFont
- TkUtil
- TkUtil::CallbackSubst
- TkUtil::CallbackSubst::Info
- TkValidateCommand
- TkValidateCommand::ValidateArgs
- TkValidation
- TkValidation::ValidateCmd
- TkValidation::ValidateCmd::Action
- TkVarAccess
- TkVariable
- TkVirtualEvent
- TkVirtualEvent::PreDefVirtEvent
- TkVirtualEvent::TkNamedVirtualEvent
- TkWarning
- TkWarning2
- TkWarningObj
- TkWidget
- TkWindow
- TkWinfo
- TkXIM
- TkcArc
- TkcBitmap
- TkcGroup
- TkcImage
- TkcItem
- TkcLine
- TkcNamedTag
- TkcOval
- TkcPolygon
- TkcRectangle
- TkcTag
- TkcTagAccess
- TkcTagAll
- TkcTagCurrent
- TkcTagString
- TkcText
- TkcWindow
- TktImage
- TktMark
- TktMarkAnchor
- TktMarkCurrent
- TktMarkInsert
- TktNamedMark
- TktNamedTag
- TktTag
- TktTagSel
- TktWindow
- Variable
- VirtualEvent
- WindowItem
- Winfo
- unknown

No matching classes.

# TkFont

autoload

### Constants

DEFAULT_KANJI_FONT_NAME
DEFAULT_LATIN_FONT_NAME
MetricType

  metric_type : default => num_or_str

OptionType

  option_type : default => string

SYSTEM_FONT_NAMES

  system font names

TkCommandNames
Tk_FontID
Tk_FontNameTBL
Tk_FontUseTBL

### Public Class Methods

actual(fnt, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 205
    def TkFont.actual(fnt, option=nil)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
       fnt.actual(option)
      else
        actual_core(fnt, nil, option)
      end
    end

actual_displayof(fnt, win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 217
    def TkFont.actual_displayof(fnt, win, option=nil)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
       fnt.actual_displayof(win, option)
      else
        win = '.' unless win
        actual_core(fnt, win, option)
      end
    end

actual_hash(fnt, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 213
    def TkFont.actual_hash(fnt, option=nil)
      Hash[TkFont.actual(fnt, option)]
    end

actual_hash_displayof(fnt, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 226
    def TkFont.actual_hash_displayof(fnt, option=nil)
      Hash[TkFont.actual_displayof(fnt, option)]
    end

configinfo(fnt, slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 239
    def TkFont.configinfo(fnt, slot=nil)
      if fnt.kind_of?(TkFont)
        fnt.configinfo(fnt, slot)
      else
        configinfo_core(fnt, slot)
      end
    end

configure(fnt, slot, value=None) click to toggle source

                   # File tk/lib/tk/font.rb, line 230
    def TkFont.configure(fnt, slot, value=None)
      if fnt.kind_of?(TkFont)
        fnt.configure(fnt, slot, value)
      else
        configure_core(fnt, slot, value)
      end
      fnt
    end

create_copy(font) click to toggle source

                   # File tk/lib/tk/font.rb, line 378
    def TkFont.create_copy(font)
      fail 'source-font must be a TkFont object' unless font.kind_of? TkFont
      if TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
        keys = {}
        font.configinfo.each{|key,value| keys[key] = value }
        TkFont.new(font.latin_font_id, font.kanji_font_id, keys)
      else # ! TkComm::GET_CONFIGINFOwoRES_AS_ARRAY
        TkFont.new(font.latin_font_id, font.kanji_font_id, font.configinfo)
      end
    end

current_configinfo(fnt, slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 247
    def TkFont.current_configinfo(fnt, slot=nil)
      if fnt.kind_of?(TkFont)
        fnt.current_configinfo(fnt, slot)
      else
        current_configinfo_core(fnt, slot)
      end
    end

failsafe(font) click to toggle source

                   # File tk/lib/tk/font.rb, line 527
    def TkFont.failsafe(font)
      begin
        if /^8\..*/ === Tk::TK_VERSION  && JAPANIZED_TK
          tk_call('font', 'failsafe', font)
        end
      rescue
      end
    end

families(win=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 347
    def TkFont.families(win=nil)
      case (Tk::TK_VERSION)
      when /^4\..*/
        ['fixed']

      when /^8\..*/
        if win
          tk_split_simplelist(tk_call('font', 'families', '-displayof', win))
        else
          tk_split_simplelist(tk_call('font', 'families'))
        end
      end
    end

get_obj(name) click to toggle source

                   # File tk/lib/tk/font.rb, line 389
    def TkFont.get_obj(name)
      name = name.to_s
      if name =~ /^(@font[0-9]+)(|c|l|k)$/
        Tk_FontNameTBL.mutex.synchronize{
          Tk_FontNameTBL[$1]
        }
      else
        Tk_FontNameTBL.mutex.synchronize{
          Tk_FontNameTBL[name]
        }
      end
    end

init_widget_font(pathname, *args) click to toggle source

                   # File tk/lib/tk/font.rb, line 402
    def TkFont.init_widget_font(pathname, *args)
      win, tag, key = pathname.split(';')
      key = 'font' if key == nil || key == ''
      path = [win, tag, key].join(';')

      case (Tk::TK_VERSION)
      when /^4\..*/
        regexp = /^-(|kanji)#{key} /

        conf_list = tk_split_simplelist(tk_call(*args)).
          find_all{|prop| prop =~ regexp}.
          collect{|prop| tk_split_simplelist(prop)}

        if conf_list.size == 0
          raise RuntimeError, "the widget may not support 'font' option"
        end

        args << {}

        ltn_key = "-#{key}"
        knj_key = "-kanji#{key}"

        ltn_info = conf_list.find{|conf| conf[0] == ltn_key}
        ltn = ltn_info[-1]
        ltn = nil if ltn == [] || ltn == ""

        knj_info = conf_list.find{|conf| conf[0] == knj_key}
        knj = knj_info[-1]
        knj = nil if knj == [] || knj == ""

        TkFont.new(ltn, knj).call_font_configure([path, key], *args)

      when /^8\.[0-4]/
        regexp = /^-#{key} /

        conf_list = tk_split_simplelist(tk_call(*args)).
          find_all{|prop| prop =~ regexp}.
          collect{|prop| tk_split_simplelist(prop)}

        if conf_list.size == 0
          raise RuntimeError, "the widget may not support 'font' option"
        end

        args << {}

        optkey = "-#{key}"

        info = conf_list.find{|conf| conf[0] == optkey}
        fnt = info[-1]
        fnt = nil if fnt == [] || fnt == ""

        unless fnt
          # create dummy
          # TkFont.new(nil, nil).call_font_configure([path, key], *args)
          dummy_fnt = TkFont.allocate
          dummy_fnt.instance_eval{ init_dummy_fontobj() }
          dummy_fnt
        else
          begin
            compound = tk_split_simplelist(
                Hash[*tk_split_simplelist(tk_call('font', 'configure',
                                                  fnt))].collect{|k,v|
                  [k[1..-1], v]
                }.assoc('compound')[1])
          rescue
            compound = []
          end
          if compound == []
            if TkFont.is_system_font?(fnt)
              TkNamedFont.new(fnt).call_font_configure([path, key], *args)
            else
              TkFont.new(fnt).call_font_configure([path, key], *args)
            end
          else
            TkFont.new(compound[0],
                       compound[1]).call_font_configure([path, key], *args)
          end
        end

      when /^8\.[5-9]/, /^9\..*/
        regexp = /^-#{key} /

        conf_list = tk_split_simplelist(tk_call(*args)).
          find_all{|prop| prop =~ regexp}.
          collect{|prop| tk_split_simplelist(prop)}

        if conf_list.size == 0
          raise RuntimeError, "the widget may not support 'font' option"
        end

        args << {}

        optkey = "-#{key}"

        info = conf_list.find{|conf| conf[0] == optkey}
        fnt = info[-1]
        fnt = nil if fnt == [] || fnt == ""

        unless fnt
          # create dummy
          # TkFont.new(nil, nil).call_font_configure([path, key], *args)
          dummy_fnt = TkFont.allocate
          dummy_fnt.instance_eval{ init_dummy_fontobj() }
          dummy_fnt
        else
          if TkFont.is_system_font?(fnt)
            TkNamedFont.new(fnt).call_font_configure([path, key], *args)
          else
            TkFont.new(fnt).call_font_configure([path, key], *args)
          end
        end
      end
    end

is_system_font?(fnt) click to toggle source

class methods

                   # File tk/lib/tk/font.rb, line 197
    def TkFont.is_system_font?(fnt)
      # true  --> system font which is available on the current system
      # false --> not system font (or unknown system font)
      # nil   --> system font name, but not available on the current system
      fnt = fnt.to_s
      SYSTEM_FONT_NAMES.include?(fnt) && self.names.index(fnt) && true
    end

measure(fnt, text) click to toggle source

                   # File tk/lib/tk/font.rb, line 255
    def TkFont.measure(fnt, text)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
        fnt.measure(text)
      else
        measure_core(fnt, nil, text)
      end
    end

measure_displayof(fnt, win, text) click to toggle source

                   # File tk/lib/tk/font.rb, line 264
    def TkFont.measure_displayof(fnt, win, text)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
        fnt.measure_displayof(win, text)
      else
        win = '.' unless win
        measure_core(fnt, win, text)
      end
    end

metrics(fnt, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 274
    def TkFont.metrics(fnt, option=nil)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
        fnt.metrics(option)
      else
        metrics_core(fnt, nil, option)
      end
    end

metrics_displayof(fnt, win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 310
    def TkFont.metrics_displayof(fnt, win, option=nil)
      fnt = '{}' if fnt == ''
      if fnt.kind_of?(TkFont)
        font.metrics_displayof(win, option=nil)
      else
        win = '.' unless win
        metrics_core(fnt, win, option)
      end
    end

metrics_hash(fnt, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 282
    def TkFont.metrics_hash(fnt, option=nil)
      if option
        val = TkFont.metrics(fnt, option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[TkFont.metrics(fnt)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

metrics_hash_displayof(fnt, win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 319
    def TkFont.metrics_hash_displayof(fnt, win, option=nil)
      if option
        val = TkFont.metrics_displayof(fnt, win, option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[TkFont.metrics_displayof(fnt, win, option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

names() click to toggle source

                   # File tk/lib/tk/font.rb, line 361
    def TkFont.names
      case (Tk::TK_VERSION)
      when /^4\..*/
        r = ['fixed']
        r += ['a14', 'k14'] if JAPANIZED_TK
        Tk_FontNameTBL.mutex.synchronize{
          Tk_FontNameTBL.each_value{|obj| r.push(obj)}
        }
        #r | []
        r.uniq

      when /^8\..*/
        tk_split_simplelist(tk_call('font', 'names'))

      end
    end

new(ltn=nil, knj=nil, keys=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 587
    def initialize(ltn=nil, knj=nil, keys=nil)
      ltn = '{}' if ltn == ''
      knj = '{}' if knj == ''

      Tk_FontID.mutex.synchronize{
        # @id = Tk_FontID.join('')
        @id = Tk_FontID.join(TkCore::INTERP._ip_id_)
        Tk_FontID[1].succ!
      }
      Tk_FontNameTBL.mutex.synchronize{
        Tk_FontNameTBL[@id] = self
      }

      # @latin_desscendant = nil
      # @kanji_desscendant = nil
      @descendant = [nil, nil] # [latin, kanji]

      # @latinfont = @id + 'l'
      # @kanjifont = @id + 'k'
      # @compoundfont = @id + 'c'
      # @fontslot = {}

      if knj.kind_of?(Hash) && !keys
        keys = knj
        knj = nil
      end

      # compound font check
      if Tk::TK_VERSION == '8.0' && JAPANIZED_TK
        begin
          compound = tk_split_simplelist(tk_call('font', 'configure',
                                                 ltn, '-compound'))
          if knj == nil
            if compound != []
              ltn, knj = compound
            end
          else
            if compound != []
              ltn = compound[0]
            end
            compound = tk_split_simplelist(tk_call('font', 'configure',
                                                   knj, '-compound'))
            if compound != []
              knj = compound[1]
            end
          end
        rescue
        end
      end

      if ltn
        if JAPANIZED_TK && !knj
          if Tk::TK_VERSION =~ /^4..*/
            knj = DEFAULT_KANJI_FONT_NAME
          else
            knj = ltn
          end
        end
      else
        ltn = DEFAULT_LATIN_FONT_NAME
        knj = DEFAULT_KANJI_FONT_NAME if JAPANIZED_TK && !knj
      end

      create_compoundfont(ltn, knj, keys)
    end

used_on(path=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 516
    def TkFont.used_on(path=nil)
      Tk_FontUseTBL.mutex.synchronize{
        if path
          Tk_FontUseTBL[path]
        else
          # Tk_FontUseTBL.values | []
          Tk_FontUseTBL.values.uniq
        end
      }
    end

### Public Instance Methods

[](slot) click to toggle source

                   # File tk/lib/tk/font.rb, line 1256
    def [](slot)
      configinfo slot
    end

[]=(slot, val) click to toggle source

                   # File tk/lib/tk/font.rb, line 1260
    def []=(slot, val)
      configure slot, val
      val
    end

actual(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1189
    def actual(option=nil)
      actual_core(@compoundfont, nil, option)
    end

actual_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1196
    def actual_displayof(win, option=nil)
      win = '.' unless win
      actual_core(@compoundfont, win, option)
    end

actual_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1192
    def actual_hash(option=nil)
      Hash[actual(option)]
    end

actual_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1200
    def actual_hash_displayof(win, option=nil)
      Hash[actual_displayof(win, option)]
    end

ascii_actual(option=nil) click to toggle source
Alias for: latin_actual
ascii_actual_displayof(win, option=nil) click to toggle source
Alias for: latin_actual_displayof
ascii_configinfo(slot=nil) click to toggle source
Alias for: latin_configinfo
ascii_configure(slot, value=None) click to toggle source
Alias for: latin_configure
ascii_font() click to toggle source

public alias

Alias for: latin_font
ascii_metrics(option=nil) click to toggle source
Alias for: latin_metrics
ascii_replace(ltn) click to toggle source
Alias for: latin_replace
asciifont() click to toggle source
Alias for: latinfont
call_font_configure(path, *args) click to toggle source

                   # File tk/lib/tk/font.rb, line 1040
    def call_font_configure(path, *args)
      if path.kind_of?(Array)
        # [path, optkey]
        win, tag = path[0].split(';')
        optkey = path[1].to_s
      else
        win, tag, optkey = path.split(';')
      end

      fontslot = _symbolkey2str(@fontslot)
      if optkey && optkey != ""
        ltn = fontslot.delete('font')
        knj = fontslot.delete('kanjifont')
        fontslot[optkey] = ltn if ltn
        fontslot["kanji#{optkey}"] = knj if knj
      end

      keys = _symbolkey2str(args.pop).update(fontslot)
      args.concat(hash_kv(keys))
      begin
        tk_call(*args)
      rescue => e
        unless TkConfigMethod.__IGNORE_UNKNOWN_CONFIGURE_OPTION__
          fail e
        end
      end
      Tk_FontUseTBL.mutex.synchronize{
        Tk_FontUseTBL[[win, tag, optkey].join(';')] = self
      }
      self
    end

configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1270
    def configinfo(slot=nil)
      configinfo_core(@compoundfont, slot)
    end

configure(slot, value=None) click to toggle source

                   # File tk/lib/tk/font.rb, line 1265
    def configure(slot, value=None)
      configure_core(@compoundfont, slot, value)
      self
    end

create_asciifont(font) click to toggle source
Alias for: create_latinfont
create_compoundfont(ltn, knj, keys) click to toggle source
Alias for: create_compoundfont_tk4x
create_kanjifont(font) click to toggle source
Alias for: create_kanjifont_tk4x
create_latinfont(font) click to toggle source
Also aliased as: create_asciifont
Alias for: create_latinfont_tk4x
current_configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1274
    def current_configinfo(slot=nil)
      current_configinfo_core(@compoundfont, slot)
    end

delete() click to toggle source

                   # File tk/lib/tk/font.rb, line 1278
    def delete
      delete_core
    end

font() click to toggle source

                   # File tk/lib/tk/font.rb, line 1140
    def font
      @compoundfont
    end

Also aliased as: font_id, name, to_s
font_id() click to toggle source
Alias for: font
id() click to toggle source

                   # File tk/lib/tk/font.rb, line 1132
    def id
      @id
    end

inspect() click to toggle source

                   # File tk/lib/tk/font.rb, line 1012
    def inspect
      sprintf("#<%s:%0x:%s>", self.class.inspect, self.__id__, @compoundfont)
    end

kanji_actual(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1227
    def kanji_actual(option=nil)
      #if JAPANIZED_TK
      if @kanjifont == nil
        actual_core(@compoundfont, nil, option) # use @compoundfont
      elsif @kanjifont != ""
        actual_core(@kanjifont, nil, option)
      else
        actual_core_tk4x(nil, nil, option)
      end
    end

kanji_actual_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1241
    def kanji_actual_displayof(win, option=nil)
      #if JAPANIZED_TK
      if @kanjifont == nil
        actual_core(@compoundfont, nil, option) # use @compoundfont
      elsif @kanjifont != ""
        win = '.' unless win
        actual_core(@kanjifont, win, option)
      else
        actual_core_tk4x(nil, win, option)
      end
    end

kanji_actual_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1237
    def kanji_actual_hash(option=nil)
      Hash[kanji_actual(option)]
    end

kanji_actual_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1252
    def kanji_actual_hash_displayof(win, option=nil)
      Hash[kanji_actual_displayof(win, option)]
    end

kanji_configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1316
    def kanji_configinfo(slot=nil)
      #if JAPANIZED_TK
      if @kanjifont == nil
        configure_core(@compoundfont, slot) # use @compoundfont
      elsif @kanjifont != ""
        configinfo_core(@kanjifont, slot)
      else
        #[]
        configinfo(slot)
      end
    end

kanji_configure(slot, value=None) click to toggle source

                   # File tk/lib/tk/font.rb, line 1302
    def kanji_configure(slot, value=None)
      #if JAPANIZED_TK
      if @kanjifont == nil
        configure_core(@compoundfont, slot, value) # use @compoundfont
      elsif @kanjifont != ""
        configure_core(@kanjifont, slot, value)
        configure('size'=>configinfo('size')) # to reflect new configuration
      else
        #""
        configure(slot, value)
      end
      self
    end

kanji_current_configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1327
    def kanji_current_configinfo(slot=nil)
      Hash[kanji_configinfo(slot)]
    end

kanji_font() click to toggle source

                   # File tk/lib/tk/font.rb, line 1172
      def kanji_font
        # @kanjifont
        if @descendant[1] # [1] -> kanji
          @descendant[1]
        else
          @descendant[1] = DescendantFont.new(self, 'kanji')
        end
    =begin
        if @kanji_descendant
          @kanji_descendant
        else
          @kanji_descendant = DescendantFont.new(self, 'kanji')
        end
    =end
      end

Also aliased as: kanjifont
kanji_font_id() click to toggle source

                   # File tk/lib/tk/font.rb, line 1168
    def kanji_font_id
      @kanjifont
    end

kanji_metrics(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1511
    def kanji_metrics(option=nil)
      if @latinfont == nil
        metrics_core(@compoundfont, nil, option) # use @compoundfont
      elsif JAPANIZED_TK
        metrics_core(@kanjifont, nil, option)
      else
        metrics_core_tk4x(nil, nil, option)
      end
    end

kanji_metrics_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1548
    def kanji_metrics_displayof(win, option=nil)
      win = '.' unless win
      if @latinfont == nil
        metrics_core(@compoundfont, win, option) # use @compoundfont
      elsif JAPANIZED_TK
        metrics_core(@kanjifont, win, option)
      else
        metrics_core_tk4x(nil, win, option)
      end
    end

kanji_metrics_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1520
    def kanji_metrics_hash(option=nil)
      if option
        val = kanji_metrics(option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[kanji_metrics(option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

kanji_metrics_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1558
    def kanji_metrics_hash_displayof(win, option=nil)
      if option
        val = kanji_metrics_displayof(win, option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[kanji_metrics_displayof(win, option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

kanji_replace(knj) click to toggle source

                   # File tk/lib/tk/font.rb, line 1361
    def kanji_replace(knj)
      return self unless @kanjifont  # ignore
      kanji_replace_core(knj)
      reset_pointadjust
      self
    end

kanjifont() click to toggle source
Alias for: kanji_font
latin_actual(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1204
    def latin_actual(option=nil)
      if @latinfont == nil
        actual_core(@compoundfont, nil, option) # use @compoundfont
      else
        actual_core(@latinfont, nil, option)
      end
    end

Also aliased as: ascii_actual
latin_actual_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1215
    def latin_actual_displayof(win, option=nil)
      win = '.' unless win
      if @latinfont == nil
        actual_core(@compoundfont, win, option) # use @compoundfont
      else
        actual_core(@latinfont, win, option)
      end
    end

Also aliased as: ascii_actual_displayof
latin_actual_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1211
    def latin_actual_hash(option=nil)
      Hash[latin_actual(option)]
    end

latin_actual_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1223
    def latin_actual_hash_displayof(win, option=nil)
      Hash[latin_actual_displayof(win, option)]
    end

latin_configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1291
    def latin_configinfo(slot=nil)
      if JAPANIZED_TK
        configinfo_core(@latinfont, slot)
      else
        configinfo(slot)
      end
    end

Also aliased as: ascii_configinfo
latin_configure(slot, value=None) click to toggle source

                   # File tk/lib/tk/font.rb, line 1282
    def latin_configure(slot, value=None)
      if JAPANIZED_TK
        configure_core(@latinfont, slot, value)
      else
        configure(slot, value)
      end
      self
    end

Also aliased as: ascii_configure
latin_current_configinfo(slot=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1298
    def latin_current_configinfo(slot=nil)
      Hash[latin_configinfo(slot)]
    end

latin_font() click to toggle source

                   # File tk/lib/tk/font.rb, line 1151
      def latin_font
        # @latinfont
        if @descendant[0] # [0] -> latin
          @descendant[0]
        else
          @descendant[0] = DescendantFont.new(self, 'latin')
        end
    =begin
        if @latin_descendant
          @latin_descendant
        else
          @latin_descendant = DescendantFont.new(self, 'latin')
        end
    =end
      end

Also aliased as: latinfont, ascii_font
latin_font_id() click to toggle source

                   # File tk/lib/tk/font.rb, line 1147
    def latin_font_id
      @latinfont
    end

latin_metrics(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1440
    def latin_metrics(option=nil)
      if @latinfont == nil
        metrics_core(@compoundfont, nil, option) # use @compoundfont
      else
        metrics_core(@latinfont, nil, option)
      end
    end

Also aliased as: ascii_metrics
latin_metrics_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1475
    def latin_metrics_displayof(win, option=nil)
      win = '.' unless win
      if @latinfont == nil
        metrics_core(@compoundfont, win, option) # use @compoundfont
      else
        metrics_core(@latinfont, win, option)
      end
    end

latin_metrics_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1447
    def latin_metrics_hash(option=nil)
      if option
        val = latin_metrics(option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[latin_metrics(option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

latin_metrics_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1483
    def latin_metrics_hash_displayof(win, option=nil)
      if option
        val = latin_metrics_displayof(win, option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[latin_metrics_displayof(win, option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

latin_replace(ltn) click to toggle source

                   # File tk/lib/tk/font.rb, line 1338
    def latin_replace(ltn)
      if @latinfont
        latin_replace_core(ltn)
        reset_pointadjust
      else
        # not compound font -> copy properties of ltn
        latinkeys = {}
        begin
          actual_core(ltn).each{|key,val| latinkeys[key] = val}
        rescue
          latinkeys = {}
        end
        begin
          tk_call('font', 'configure', @compoundfont, *hash_kv(latinkeys))
        rescue
          # not exist? (deleted?) -> create font
          tk_call('font', 'create', @compoundfont, *hash_kv(latinkeys))
        end
      end

      self
    end

Also aliased as: ascii_replace
latinfont() click to toggle source
Also aliased as: asciifont
Alias for: latin_font
measure(text) click to toggle source

                   # File tk/lib/tk/font.rb, line 1368
    def measure(text)
      measure_core(@compoundfont, nil, text)
    end

measure_displayof(win, text) click to toggle source

                   # File tk/lib/tk/font.rb, line 1372
    def measure_displayof(win, text)
      win = '.' unless win
      measure_core(@compoundfont, win, text)
    end

method_missing(id, *args) click to toggle source

                   # File tk/lib/tk/font.rb, line 1016
      def method_missing(id, *args)
        name = id.id2name
        case args.length
        when 1
          if name[-1] == ?=
            configure name[0..-2], args[0]
            args[0]
          else
            configure name, args[0]
            self
          end
        when 0
          begin
            configinfo name
          rescue
            super(id, *args)
    #        fail NameError, "undefined local variable or method `#{name}' for #{self.to_s}", error_at
          end
        else
          super(id, *args)
    #      fail NameError, "undefined method `#{name}' for #{self.to_s}", error_at
        end
      end

metrics(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1377
    def metrics(option=nil)
      metrics_core(@compoundfont, nil, option)
    end

metrics_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1408
    def metrics_displayof(win, option=nil)
      win = '.' unless win
      metrics_core(@compoundfont, win, option)
    end

metrics_hash(option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1380
    def metrics_hash(option=nil)
      if option
        val = metrics(option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[metrics(option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

metrics_hash_displayof(win, option=nil) click to toggle source

                   # File tk/lib/tk/font.rb, line 1412
    def metrics_hash_displayof(win, option=nil)
      if option
        val = metrics_displayof(win, option)
        case TkFont::MetricsType[option.to_s]
        when ?n
          val = TkComm::num_or_str(val)
        when ?b
          val = TkComm::bool(val)
        else
          # do nothing
        end
        return val
      end

      h = Hash[metrics_displayof(win, option)]
      h.keys.each{|k|
        case TkFont::MetricsType[k.to_s]
        when ?n
          h[k] = TkComm::num_or_str(h[k])
        when ?b
          h[k] = TkComm::bool(h[k])
        else
          # do nothing
        end
      }
      h
    end

mutex() click to toggle source

                   # File tk/lib/tk/font.rb, line 16
    def mutex; @mutex; end

name() click to toggle source
Alias for: font
replace(ltn, knj=None) click to toggle source

                   # File tk/lib/tk/font.rb, line 1331
    def replace(ltn, knj=None)
      knj = ltn if knj == None
      latin_replace(ltn)
      kanji_replace(knj)
      self
    end

reset_pointadjust() click to toggle source

                   # File tk/lib/tk/font.rb, line 1586
    def reset_pointadjust
      begin
        if /^8\..*/ === Tk::TK_VERSION  && JAPANIZED_TK
          configure('pointadjust' => latin_actual.assoc('size')[1].to_f /
                                        kanji_actual.assoc('size')[1].to_f )
        end
      rescue
      end
      self
    end

to_eval() click to toggle source

                   # File tk/lib/tk/font.rb, line 1136
    def to_eval
      font
    end

to_s() click to toggle source
Alias for: font
used() click to toggle source

                   # File tk/lib/tk/font.rb, line 1072
    def used
      ret = []
      table = nil
      Tk_FontUseTBL.mutex.synchronize{
        table = Tk_FontUseTBL.clone # to avoid deadlock
      }
      table.each{|key,value|
        next unless self == value
        if key.include?(';')
          win, tag, optkey = key.split(';')
          winobj = tk_tcl2ruby(win)
          #if winobj.kind_of? TkText
          if winobj.kind_of?(TkText) || winobj.kind_of?(Tk::Text)
            if optkey
              ret.push([winobj, winobj.tagid2obj(tag), optkey])
            else
              ret.push([winobj, winobj.tagid2obj(tag)])
            end
          #elsif winobj.kind_of? TkCanvas
          elsif winobj.kind_of?(TkCanvas) || winobj.kind_of?(Tk::Canvas)
            if (tagobj = TkcTag.id2obj(winobj, tag)).kind_of? TkcTag
              if optkey
                ret.push([winobj, tagobj, optkey])
              else
                ret.push([winobj, tagobj])
              end
            elsif (tagobj = TkcItem.id2obj(winobj, tag)).kind_of? TkcItem
              if optkey
                ret.push([winobj, tagobj, optkey])
              else
                ret.push([winobj, tagobj])
              end
            else
              if optkey
                ret.push([winobj, tag, optkey])
              else
                ret.push([winobj, tag])
              end
            end
          #elsif winobj.kind_of? TkMenu
          elsif winobj.kind_of?(TkMenu) || winobj.kind_of?(Tk::Menu)
            if optkey
              ret.push([winobj, tag, optkey])
            else
              ret.push([winobj, tag])
            end
          else
            if optkey
              ret.push([win, tag, optkey])
            else
              ret.push([win, tag])
            end
          end
        else
          ret.push(tk_tcl2ruby(key))
        end
      }
      ret
    end