module Fox
  #
  # Font style
  #
  class FXFontDesc

    # Typeface name, such as "helvetica" [String]
    attr_accessor :face
    
    # Font size in decipoints [Integer]
    attr_accessor :size
    
    # Font weight, such as +FONTWEIGHT_NORMAL+ or +FONTWEIGHT_BOLD+ [Integer].
    # See FXFont documentation for the complete list of font weight values.
    attr_accessor :weight
  
    # Font slant, such as +FONTSLANT_REGULAR+ or +FONTSLANT_ITALIC+ [Integer].
    # See FXFont documentation for the complete list of font slant values.
    attr_accessor :slant
    
    # Character set encoding, such as <tt>FONTENCODING_ISO_8859_1</tt> or <tt>FONTENCODING_LATIN1</tt> [Integer].
    # See FXFont documentation for the complete list of character set encoding values.
    attr_accessor :encoding
    
    # Font set width, such as +FONTSETWIDTH_CONDENSED+ or +FONTSETWIDTH_WIDE+ [Integer].
    # See FXFont documentation for the complete list of font set width values.
    attr_accessor :setwidth
    
    # Flags [Integer]
    attr_accessor :flags

    #
    # Constructor
    #
    def initialize ; end
  end

  #
  # Font class
  #
  # === Font style hints which influence the matcher
  #
  # <tt>FONTPITCH_DEFAULT</tt>::	Default pitch
  # <tt>FONTPITCH_FIXED</tt>::		Fixed pitch, mono-spaced
  # <tt>FONTPITCH_VARIABLE</tt>::	Variable pitch, proportional spacing
  # <tt>FONTHINT_DONTCARE</tt>::	Don't care which font
  # <tt>FONTHINT_DECORATIVE</tt>::	Fancy fonts
  # <tt>FONTHINT_MODERN</tt>::		Monospace typewriter font
  # <tt>FONTHINT_ROMAN</tt>::		Variable width times-like font, serif
  # <tt>FONTHINT_SCRIPT</tt>::		Script or cursive
  # <tt>FONTHINT_SWISS</tt>::		Helvetica/swiss type font, sans-serif
  # <tt>FONTHINT_SYSTEM</tt>::		System font
  # <tt>FONTHINT_X11</tt>::		X11 Font string
  # <tt>FONTHINT_SCALABLE</tt>::	Scalable fonts
  # <tt>FONTHINT_POLYMORPHIC</tt>::	Polymorphic fonts
  #
  # === Font slant
  #
  # +FONTSLANT_DONTCARE+::		Don't care about slant
  # +FONTSLANT_REGULAR+::		Regular straight up
  # +FONTSLANT_ITALIC+::		Italics
  # +FONTSLANT_OBLIQUE+::		Oblique slant
  # +FONTSLANT_REVERSE_ITALIC+::	Reversed italic
  # +FONTSLANT_REVERSE_OBLIQUE+::	Reversed oblique
  #
  # === Font character set encoding
  #
  # <tt>FONTENCODING_DEFAULT</tt>::		Don't care character encoding
  # <tt>FONTENCODING_ISO_8859_1</tt>::		ISO-8859-1 character encoding
  # <tt>FONTENCODING_ISO_8859_2</tt>::		ISO-8859-2 character encoding
  # <tt>FONTENCODING_ISO_8859_3</tt>::		ISO-8859-3 character encoding
  # <tt>FONTENCODING_ISO_8859_4</tt>::		ISO-8859-4 character encoding
  # <tt>FONTENCODING_ISO_8859_5</tt>:: 		ISO-8859-5 character encoding
  # <tt>FONTENCODING_ISO_8859_6</tt>::		ISO-8859-6 character encoding
  # <tt>FONTENCODING_ISO_8859_7</tt>::		ISO-8859-7 character encoding
  # <tt>FONTENCODING_ISO_8859_8</tt>::		ISO-8859-8 character encoding
  # <tt>FONTENCODING_ISO_8859_9</tt>::		ISO-8859-9 character encoding
  # <tt>FONTENCODING_ISO_8859_10</tt>::		ISO-8859-10 character encoding
  # <tt>FONTENCODING_ISO_8859_11</tt>::		ISO-8859-11 character encoding
  # <tt>FONTENCODING_ISO_8859_13</tt>::		ISO-8859-13 character encoding
  # <tt>FONTENCODING_ISO_8859_14</tt>::		ISO-8859-14 character encoding
  # <tt>FONTENCODING_ISO_8859_15</tt>::		ISO-8859-15 character encoding
  # <tt>FONTENCODING_ISO_8859_16</tt>::		ISO-8859-16 character encoding
  # <tt>FONTENCODING_KOI8</tt>::		KOI-8 character encoding
  # <tt>FONTENCODING_KOI8_R</tt>::		Russian
  # <tt>FONTENCODING_KOI8_U</tt>::		Ukrainian
  # <tt>FONTENCODING_KOI8_UNIFIED</tt>::	x
  # <tt>FONTENCODING_LATIN1</tt>::		same as <tt>FONTENCODING_ISO_8859_1</tt>, Latin 1 (West European)
  # <tt>FONTENCODING_LATIN2</tt>::		same as <tt>FONTENCODING_ISO_8859_2</tt>, Latin 2 (East European) 
  # <tt>FONTENCODING_LATIN3</tt>::		same as <tt>FONTENCODING_ISO_8859_3</tt>, Latin 3 (South European) 
  # <tt>FONTENCODING_LATIN4</tt>::		same as <tt>FONTENCODING_ISO_8859_4</tt>, Latin 4 (North European) 
  # <tt>FONTENCODING_LATIN5</tt>::		same as <tt>FONTENCODING_ISO_8859_9</tt>, Latin 5 (Turkish) 
  # <tt>FONTENCODING_LATIN6</tt>::		same as <tt>FONTENCODING_ISO_8859_10</tt>, Latin 6 (Nordic) 
  # <tt>FONTENCODING_LATIN7</tt>::		same as <tt>FONTENCODING_ISO_8859_13</tt>, Latin 7 (Baltic Rim)
  # <tt>FONTENCODING_LATIN8</tt>::		same as <tt>FONTENCODING_ISO_8859_14</tt>, Latin 8 (Celtic)
  # <tt>FONTENCODING_LATIN9</tt>::		same as <tt>FONTENCODING_ISO_8859_15</tt>, Latin 9 (a.k.a. Latin 0)
  # <tt>FONTENCODING_LATIN10</tt>::		same as <tt>FONTENCODING_ISO_8859_16</tt>, Latin 10
  # <tt>FONTENCODING_USASCII</tt>::		same as <tt>FONTENCODING_ISO_8859_1</tt>, Latin 1
  # <tt>FONTENCODING_WESTEUROPE</tt>::		same as <tt>FONTENCODING_ISO_8859_1</tt>, Latin 1 (West European) 
  # <tt>FONTENCODING_EASTEUROPE</tt>::		same as <tt>FONTENCODING_ISO_8859_2</tt>, Latin 2 (East European) 
  # <tt>FONTENCODING_SOUTHEUROPE</tt>::		same as <tt>FONTENCODING_ISO_8859_3</tt>, Latin 3 (South European) 
  # <tt>FONTENCODING_NORTHEUROPE</tt>::		same as <tt>FONTENCODING_ISO_8859_4</tt>, Latin 4 (North European) 
  # <tt>FONTENCODING_CYRILLIC</tt>::		same as <tt>FONTENCODING_ISO_8859_5</tt>, Cyrillic
  # <tt>FONTENCODING_RUSSIAN</tt>::		same as <tt>FONTENCODING_KOI8</tt>, Cyrillic
  # <tt>FONTENCODING_ARABIC</tt>::		same as <tt>FONTENCODING_ISO_8859_6</tt>, Arabic
  # <tt>FONTENCODING_GREEK</tt>::		same as <tt>FONTENCODING_ISO_8859_7</tt>, Greek
  # <tt>FONTENCODING_HEBREW</tt>::		same as <tt>FONTENCODING_ISO_8859_8</tt>, Hebrew
  # <tt>FONTENCODING_TURKISH</tt>::		same as <tt>FONTENCODING_ISO_8859_9</tt>, Latin 5 (Turkish) 
  # <tt>FONTENCODING_NORDIC</tt>::		same as <tt>FONTENCODING_ISO_8859_10</tt>, Latin 6 (Nordic) 
  # <tt>FONTENCODING_THAI</tt>::		same as <tt>FONTENCODING_ISO_8859_11</tt>, Thai
  # <tt>FONTENCODING_BALTIC</tt>::		same as <tt>FONTENCODING_ISO_8859_13</tt>, Latin 7 (Baltic Rim)
  # <tt>FONTENCODING_CELTIC</tt>::		same as <tt>FONTENCODING_ISO_8859_14, Latin 8 (Celtic)
  #
  # === Font weight
  #
  # +FONTWEIGHT_DONTCARE+::	Don't care about weight
  # +FONTWEIGHT_THIN+::		Thin
  # +FONTWEIGHT_EXTRALIGHT+::	Extra light
  # +FONTWEIGHT_LIGHT+::	Light
  # +FONTWEIGHT_NORMAL+::	Normal or regular weight
  # +FONTWEIGHT_REGULAR+::	Normal or regular weight
  # +FONTWEIGHT_MEDIUM+::	Medium bold face
  # +FONTWEIGHT_DEMIBOLD+::	Demi bold face
  # +FONTWEIGHT_BOLD+::		Bold face
  # +FONTWEIGHT_EXTRABOLD+::	Extra
  # +FONTWEIGHT_HEAVY+::	Heavy
  # +FONTWEIGHT_BLACK+::	Black
  #
  # === Font relative setwidth
  #
  # +FONTSETWIDTH_DONTCARE+::		Don't care about set width
  # +FONTSETWIDTH_ULTRACONDENSED+::	Ultra condensed printing
  # +FONTSETWIDTH_EXTRACONDENSED+::	Extra condensed
  # +FONTSETWIDTH_CONDENSED+::		Condensed
  # +FONTSETWIDTH_NARROW+::		Narrow
  # +FONTSETWIDTH_COMPRESSED+::		Compressed
  # +FONTSETWIDTH_SEMICONDENSED+::	Semi-condensed
  # +FONTSETWIDTH_MEDIUM+::		Medium printing
  # +FONTSETWIDTH_NORMAL+::		Normal printing
  # +FONTSETWIDTH_REGULAR+::		Regular printing
  # +FONTSETWIDTH_SEMIEXPANDED+::	Semi expanded
  # +FONTSETWIDTH_EXPANDED+::		Expanded
  # +FONTSETWIDTH_WIDE+::		Wide
  # +FONTSETWIDTH_EXTRAEXPANDED+::	Extra expanded
  # +FONTSETWIDTH_ULTRAEXPANDED+::	Ultra expanded

  class FXFont < FXId

    # Face name [String]
    attr_reader	:name

    # Size in decipoints [Integer]
    attr_reader	:size

    # Font weight [Integer]
    attr_reader	:weight

    # Slant [Integer]
    attr_reader	:slant

    # Encoding [Integer]
    attr_reader	:encoding

    # Set width [Integer]
    attr_reader	:setWidth

    # Hints [Integer]
    attr_reader	:hints

    # Font description [FXFontDesc]
    attr_accessor :fontDesc

    # First character glyph in font [Integer]
    attr_reader	:minChar

    # Last character glyph in font [Integer]
    attr_reader	:maxChar

    # Width of widest character in font [Integer]
    attr_reader	:fontWidth

    # Height of tallest character in font [Integer]
    attr_reader	:fontHeight

    # Ascent from baseline [Integer]
    attr_reader	:fontAscent

    # Descent from baseline [Integer]
    attr_reader	:fontDescent

    # Font leading [Integer]
    attr_reader	:fontLeading

    # Font line spacing [Integer]
    attr_reader	:fontSpacing

    #
    # Return an FXFont instance, initialized from a font description.
    #
    # ==== Parameters:
    #
    # +a+::		an application instance [FXApp]
    # +fontDesc+::	a font description [FXFontDesc]
    #
    def initialize(a, fontDesc) # :yields: theFont
    end
  
    #
    # Return an FXFont instance initialized with the given face name, size in
    # points (pixels), weight, slant, character set encoding, set width, and hints.
    #
    # ==== Parameters:
    #
    # +a+::		an application instance [FXApp]
    # +face+::		font face name [String]
    # +size+::		requested font size, in points [Integer]
    # +weight+::	requested font weight [Integer]
    # +encoding+::	requested font encoding [Integer]
    # +setWidth+::	requested font set width [Integer]
    # +hints+::		font construction hints for font matching algorithm [Integer]
    #
    def initialize(a, face, size, weight=FONTWEIGHT_NORMAL, slant=FONTSLANT_REGULAR, encoding=FONTENCODING_DEFAULT, setWidth=FONTSETWIDTH_DONTCARE, hints=0) # :yields: theFont
    end
  
    #
    # Return an FXFont instance initialized from the given X11 font string.
    #
    def initialize(a, fontString) # :yields: theFont
    end

    #
    # Return +true+ if font is monospaced.
    #
    def fontMono? ; end
  
    #
    # Return +true+ if font has glyph for _ch_.
    #
    def hasChar?(ch) ; end

    #
    # Returns the left-side bearing (the distance from the origin to the leftmost pixel in the character) for _ch_.
    #
    def leftBearing(ch) ; end
  
    #
    # Returns the right-side bearing (the distance from the origin to the rightmost pixel in the character) for _ch_.
    #
    def rightBearing(ch) ; end
  
    #
    # Returns the width of given _text_ in this font.
    #
    def getTextWidth(text) ; end
  
    #
    # Returns the height of given _text_ in this font.
    #
    def getTextHeight(text) ; end
  
    #
    # List all fonts matching hints. Returns an array of FXFontDesc objects.
    #
    def FXFont.listFonts(face, weight=FONTWEIGHT_DONTCARE, slant=FONTSLANT_DONTCARE, setWidth=FONTSETWIDTH_DONTCARE, encoding=FONTENCODING_DEFAULT, hints=0)
    end
  end
end

