TABLE OF CONTENTS


TkAda/Font [ Packages ]

[ Top ] [ TkAda ] [ Packages ]

FUNCTION

 Provides code for manipulate Tk command Font

SOURCE

package Tcl.Tk.Ada.Font with
   SPARK_Mode
is

Font/Font.Actual_(current_interpreter) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the actual attributes of the selected font in the current interpreter

SOURCE

   function Actual
     (FontDescription: in String; Options: in String := "") return String with
      Pre => FontDescription /= "";

PARAMETERS

 FontDescription - Font description (in Tk term, can be name or
                   declaration)
 Options         - Options passed to the command font actual. Can be
                   empty. Default value is empty

RESULT

 If attribute is not specified, return all possible attributes with their
 values. Otherwise return value of the selected attribute

EXAMPLE

   -- Get the size of font with name MyFont
   Font_Size: constant String := Actual("MyFont", "-size");
   -- Get all attributes of the system font
   Font_Attributes: constant String := Actual("system");

SEE ALSO

 Font.Actual_(selected_interpreter)

COMMANDS

 font actual font -displayof . ?option? ?--? ?char?

HISTORY

 8.6.6 - Added

Font/Font.Actual_(selected_interpreter) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the actual attributes of the selected font in the current interpreter

SOURCE

   function Actual
     (Interp: in Tcl_Interp; FontDescription: in String;
      Options: in String := "") return String with
      Pre => FontDescription /= "";

PARAMETERS

 Interp          - Tcl interpreter on which font will be check
 FontDescription - Font description (in Tk term, can be name or
                   declaration)
 Options         - Options passed to the command font actual. Can be
                   empty. Default value is empty

RESULT

 If attribute is not specified, return all possible attributes with their
 values. Otherwise return value of the selected attribute

EXAMPLE

      -- Get the weight of font with name MyFont on interpreter My_Interpreter
      Font_Weight: constant String := Actual(My_Interpreter, "MyFont", "-weight");
      -- Get all attributes of the system font on interpreter Main_Tk
      Font_Attributes: constant String := Actual(Main_Tk, "system");

SEE ALSO

 Font.Actual_(current_interpreter)

COMMANDS

 font actual font -displayof . ?option? ?--? ?char?

HISTORY

 8.6.6 - Added

Font/Font.Configure_(function) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the selected options for the selected font in the selected Tcl
 interpreter

SOURCE

   function Configure
     (FontName: in String; Option: in String := "";
      Interp: Tcl_Interp := Get_Context) return String with
      Pre => FontName /= "";

PARAMETERS

 FontName - Name of the font which options will be modified
 Option   - Name of the option which value will be taken. Default
            value is empty
 Interp   - Tcl interpreter on which the selected font is. Default
            value is current interpreter

RESULT

 If Option is empty return list of all available options and their
 values. Otherwise return value of the selected option

EXAMPLE

      -- Get the family of the font My_Font on the current interpreter
      Font_Family: constant String := Configure("My_Font", "-family");

SEE ALSO

 Font.Configure_(procedure)

COMMANDS

 font configure fontname ?option?

HISTORY

 8.6.6 - Added

Font/Font.Configure_(procedure) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Set the selected options for the selected font in the selected Tcl
 interpreter

SOURCE

   procedure Configure
     (FontName, Options: in String; Interp: Tcl_Interp := Get_Context) with
      Pre => FontName /= "" and Options /= "";

PARAMETERS

 FontName - Name of the font which options will be modified
 Options  - Names and new values for the options to set
 Interp   - Tcl interpreter on which the selected font is. Default
            value is current interpreter

EXAMPLE

      -- Set the slant of the font My_Font to roman on interpreter My_Interpreter
      Configure("My_Font", "-slant roman", My_Interpreter);

SEE ALSO

 Font.Configure_(function)

COMMANDS

 font configure fontname option value ?option value ...?

HISTORY

 8.6.6 - Added

Font/Font.Create_(function) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Create the new font with the selected name and options

SOURCE

   function Create
     (FontName, Options: in String := ""; Interp: Tcl_Interp := Get_Context)
      return String;

PARAMETERS

 FontName - Name of the font to create. Can be empty. Default value
            is empty
 Options  - Options to set for the font. Can be empty. Default value
            is empty
 Interp   - Tcl interpreter on which the font will be created is.
            Default value is current interpreter

RESULT

 The name of newly created font. If FontName is empty, the new font
 name has form "fontx" where x is an integer.

EXAMPLE

      -- Create font with random name and slant roman on My_Interpreter interpreter
      FontName: constant String := Create(Options => "-slant roman", Interp => My_Interpreter);

SEE ALSO

 Font.Create_(procedure)

COMMANDS

 font create ?fontname? ?option value ...?

HISTORY

 8.6.6 - Added

Font/Font.Create_(procedure) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Create the new font with the selected name and options

SOURCE

   procedure Create
     (FontName: in String; Options: in String := "";
      Interp: Tcl_Interp := Get_Context) with
      Pre => FontName /= "";

PARAMETERS

 FontName - Name of the font to create
 Options  - Options to set for the font. Can be empty. Default value
            is empty
 Interp   - Tcl interpreter on which the font will be created is.
            Default value is current interpreter

EXAMPLE

      -- Create font My_Font with size of 10pts on current interpreter
      Create("My_Font", "-size 10");

SEE ALSO

 Font.Create_(function)

COMMANDS

 font create ?fontname? ?option value ...?

HISTORY

 8.6.6 - Added

Font/Font.Delete [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Delete the selected font(s)

SOURCE

   procedure Delete
     (FontName: in String; Interp: Tcl_Interp := Get_Context) with
      Pre => FontName /= "";

PARAMETERS

 FontName - Name (or names) of the font(s) to delete
 Interp   - Tcl interpreter on which the font(s) will be deleted.
            Default value is current interpreter

EXAMPLE

      -- Delete font with name My_Font on current interpreter
      Delete("My_Font");
      -- Delete fonts Font1 and Font2 on My_Interpreter interpreter
      Delete("Font1 Font2", My_Interpreter);

COMMANDS

 font delete fontname ?fontname ...?

HISTORY

 8.6.6 - Added

Font/Font.Families_(current_interpreter_main_window) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get all font families names available at the current interpreter main
 window

SOURCE

   function Families return String;

RESULT

 List of case-insensitives names of available fonts

EXAMPLE

      -- Get the list of all available font families
      Font_Families: constant String := Families;

SEE ALSO

 Font.Families_(selected_window)

COMMANDS

 font families

HISTORY

 8.6.6 - Added

Font/Font.Families_(selected_window) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get all font families names available at the selected window

SOURCE

   function Families(Widget: Tk_Widget'Class) return String;

PARAMETERS

 Widget - Tk_Widget which will be queried for the available fonts families

RESULT

 List of case-insensitives names of available fonts

EXAMPLE

   -- Get the list of all available font families on My_Window widget's
   -- -- display
   -- Font_Families: constant String := Families(My_Window);

SEE ALSO

 Font.Families_(current_interpreter_main_window)

COMMANDS

 font families -displayof widget

HISTORY

 8.6.6 - Added

Font/Font.Measure_(selected_interpreter_main_window) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the width in pixels of selected text with the selected font

SOURCE

   function Measure
     (Font, Text: in String; Interp: Tcl_Interp := Get_Context)
      return String with
      Pre => Font /= "" and Text /= "";

PARAMETERS

 Font   - The font description used to measure width of text
 Text   - The text which width will be measured
 Interp - Tcl interpreter on which measuring will be done. Can be empty.
          Default value is the current interpreter

RESULT

 Width in pixels of the selected text with the selected font

EXAMPLE

   -- Get the width of text "text" in My_Font on the current interpreter
   Font_Width: constant String := Measure("My_Font", "text");

SEE ALSO

 Font.Measure_(selected_window)

COMMANDS

 font measure font -displayof interp text

HISTORY

 8.6.6 - Added

Font/Font.Measure_(selected_window) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the width in pixels of selected text with the selected font

SOURCE

   function Measure
     (Font, Text: in String; Widget: Tk_Widget'Class) return String with
      Pre => Font /= "" and Text /= "";

PARAMETERS

 Font   - The font description used to measure width of text
 Text   - The text which width will be measured
 Widget - Tk_Widget in which the Text will be measured

RESULT

 Width in pixels of the selected text with the selected font

EXAMPLE

      -- Get the width of text "text" in My_Font on My_Window widget
      Font_Width: constant String := Measure("My_Font", "text", My_Window);

SEE ALSO

 Font.Measure_(selected_interpreter_main_window)

COMMANDS

 font measure font -displayof interp text

HISTORY

 8.6.6 - Added

Font/Font.Metrics_(selected_intepreter) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the metrics of the selected font

SOURCE

   function Metrics
     (Font: in String; Option: in String := "";
      Interp: Tcl_Interp := Get_Context) return String with
      Pre => Font /= "";

PARAMETERS

 Font   - The font which options will be queried
 Option - The font option to take. Can be empty. Default value is empty
 Interp - Tcl interpreter on which the font will be queried

RESULT

 If Option is empty, return all metrics as list of pairs name, value.
 Otherwise return value of the selected option

EXAMPLE

      -- Check if My_Font is fixed (monospace) font
      Is_Monospace: constant String := Metrics("MyFont", "-fixed");

SEE ALSO

 Font.Metrics_(selected_window)

COMMANDS

 font metrics font -displayof interp ?option?

HISTORY

 8.6.6 - Added

Font/Font.Metrics_(selected_window) [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the metrics of the selected font

SOURCE

   function Metrics
     (Font: in String; Option: in String := ""; Widget: Tk_Widget'Class)
      return String with
      Pre => Font /= "";

PARAMETERS

 Font   - The font which options will be queried
 Option - The font option to take. Can be empty. Default value is empty
 Widget - Tk_Widget in which the font will be queried

RESULT

 If Option is empty, return all metrics as list of pairs name, value.
 Otherwise return value of the selected option

EXAMPLE

      -- Get all the metrics of the font My_Font in My_Window widget
      Font_Metrics: constant String := Metrics("My_Font", "", My_Window);

SEE ALSO

 Font.Metrics_(selected_intepreter)

COMMANDS

 font metrics font -displayof interp ?option?

HISTORY

 8.6.6 - Added

Font/Font.Names [ Subprograms ]

[ Top ] [ Font ] [ Subprograms ]

FUNCTION

 Get the names of the all available fonts on the selected Tcl
 interpreter

SOURCE

   function Names(Interp: Tcl_Interp := Get_Context) return String;

PARAMETERS

 Interp - Tcl interpreter on which the font will be queried. Can be
          empty. Default value is current interpreter

RESULT

 List with names of all available fonts on the selected Tcl interpreter

EXAMPLE

      -- Get the names of the all available fonts on the current interpreter
      Font_Names: constant String := Names;

COMMANDS

 font names

HISTORY

 8.6.6 - Added