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 FONTENCODING_ISO_8859_1 or FONTENCODING_LATIN1 [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
#
# FONTPITCH_DEFAULT:: Default pitch
# FONTPITCH_FIXED:: Fixed pitch, mono-spaced
# FONTPITCH_VARIABLE:: Variable pitch, proportional spacing
# FONTHINT_DONTCARE:: Don't care which font
# FONTHINT_DECORATIVE:: Fancy fonts
# FONTHINT_MODERN:: Monospace typewriter font
# FONTHINT_ROMAN:: Variable width times-like font, serif
# FONTHINT_SCRIPT:: Script or cursive
# FONTHINT_SWISS:: Helvetica/swiss type font, sans-serif
# FONTHINT_SYSTEM:: System font
# FONTHINT_X11:: X11 Font string
# FONTHINT_SCALABLE:: Scalable fonts
# FONTHINT_POLYMORPHIC:: 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
#
# FONTENCODING_DEFAULT:: Don't care character encoding
# FONTENCODING_ISO_8859_1:: West European (Latin1)
# FONTENCODING_ISO_8859_2:: Central and East European (Latin2)
# FONTENCODING_ISO_8859_3:: Esperanto (Latin3)
# FONTENCODING_ISO_8859_4:: ISO-8859-4 character encoding
# FONTENCODING_ISO_8859_5:: Cyrillic (almost obsolete)
# FONTENCODING_ISO_8859_6:: Arabic
# FONTENCODING_ISO_8859_7:: Greek
# FONTENCODING_ISO_8859_8:: Hebrew
# FONTENCODING_ISO_8859_9:: Turkish (Latin5)
# FONTENCODING_ISO_8859_10:: ISO-8859-10 character encoding
# FONTENCODING_ISO_8859_11:: Thai
# FONTENCODING_ISO_8859_13:: Baltic
# FONTENCODING_ISO_8859_14:: ISO-8859-14 character encoding
# FONTENCODING_ISO_8859_15:: ISO-8859-15 character encoding
# FONTENCODING_ISO_8859_16:: ISO-8859-16 character encoding
# FONTENCODING_KOI8:: KOI-8 character encoding
# FONTENCODING_KOI8_R:: Russian
# FONTENCODING_KOI8_U:: Ukrainian
# FONTENCODING_KOI8_UNIFIED:: x
#
# FONTENCODING_CP437:: IBM-PC code page
# FONTENCODING_CP850:: IBM-PC Multilingual
# FONTENCODING_CP851:: IBM-PC Greek
# FONTENCODING_CP852:: IBM-PC Latin2
# FONTENCODING_CP855:: IBM-PC Cyrillic
# FONTENCODING_CP856:: IBM-PC Hebrew
# FONTENCODING_CP857:: IBM-PC Turkish
# FONTENCODING_CP860:: IBM-PC Portugese
# FONTENCODING_CP861:: IBM-PC Iceland
# FONTENCODING_CP862:: IBM-PC Israel
# FONTENCODING_CP863:: IBM-PC Canadian/French
# FONTENCODING_CP864:: IBM-PC Arabic
# FONTENCODING_CP865:: IBM-PC Nordic
# FONTENCODING_CP866:: IBM-PC Cyrillic #2
# FONTENCODING_CP869:: IBM-PC Greek #2
# FONTENCODING_CP870:: Latin-2 Multilingual
#
# FONTENCODING_CP1250:: Windows Central European
# FONTENCODING_CP1251:: Windows Russian
# FONTENCODING_CP1252:: Windows Latin1
# FONTENCODING_CP1253:: Windows Greek
# FONTENCODING_CP1254:: Windows Turkish
# FONTENCODING_CP1255:: Windows Hebrew
# FONTENCODING_CP1256:: Windows Arabic
# FONTENCODING_CP1257:: Windows Baltic
# FONTENCODING_CP1258:: Windows Vietnam
# FONTENCODING_CP874:: Windows Thai
#
# FONTENCODING_LATIN1:: same as FONTENCODING_ISO_8859_1, Latin 1 (West European)
# FONTENCODING_LATIN2:: same as FONTENCODING_ISO_8859_2, Latin 2 (East European)
# FONTENCODING_LATIN3:: same as FONTENCODING_ISO_8859_3, Latin 3 (South European)
# FONTENCODING_LATIN4:: same as FONTENCODING_ISO_8859_4, Latin 4 (North European)
# FONTENCODING_LATIN5:: same as FONTENCODING_ISO_8859_9, Latin 5 (Turkish)
# FONTENCODING_LATIN6:: same as FONTENCODING_ISO_8859_10, Latin 6 (Nordic)
# FONTENCODING_LATIN7:: same as FONTENCODING_ISO_8859_13, Latin 7 (Baltic Rim)
# FONTENCODING_LATIN8:: same as FONTENCODING_ISO_8859_14, Latin 8 (Celtic)
# FONTENCODING_LATIN9:: same as FONTENCODING_ISO_8859_15, Latin 9 (a.k.a. Latin 0)
# FONTENCODING_LATIN10:: same as FONTENCODING_ISO_8859_16, Latin 10
# FONTENCODING_USASCII:: same as FONTENCODING_ISO_8859_1, Latin 1
# FONTENCODING_WESTEUROPE:: same as FONTENCODING_ISO_8859_1, Latin 1 (West European)
# FONTENCODING_EASTEUROPE:: same as FONTENCODING_ISO_8859_2, Latin 2 (East European)
# FONTENCODING_SOUTHEUROPE:: same as FONTENCODING_ISO_8859_3, Latin 3 (South European)
# FONTENCODING_NORTHEUROPE:: same as FONTENCODING_ISO_8859_4, Latin 4 (North European)
# FONTENCODING_CYRILLIC:: same as FONTENCODING_ISO_8859_5, Cyrillic
# FONTENCODING_RUSSIAN:: same as FONTENCODING_KOI8, Cyrillic
# FONTENCODING_ARABIC:: same as FONTENCODING_ISO_8859_6, Arabic
# FONTENCODING_GREEK:: same as FONTENCODING_ISO_8859_7, Greek
# FONTENCODING_HEBREW:: same as FONTENCODING_ISO_8859_8, Hebrew
# FONTENCODING_TURKISH:: same as FONTENCODING_ISO_8859_9, Latin 5 (Turkish)
# FONTENCODING_NORDIC:: same as FONTENCODING_ISO_8859_10, Latin 6 (Nordic)
# FONTENCODING_THAI:: same as FONTENCODING_ISO_8859_11, Thai
# FONTENCODING_BALTIC:: same as FONTENCODING_ISO_8859_13, Latin 7 (Baltic Rim)
# FONTENCODING_CELTIC:: same as 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
# Font family name [String]
attr_reader :name
# Actual font family name [String]
attr_reader :actualName
# Size in decipoints [Integer]
attr_reader :size
# Actual size in deci-points [Integer]
attr_reader :actualSize
# Font weight [Integer]
attr_reader :weight
# Actual font weight [Integer]
attr_reader :actualWeight
# Slant [Integer]
attr_reader :slant
# Actual slant [Integer]
attr_reader :actualSlant
# Encoding [Integer]
attr_reader :encoding
# Actual encoding [Integer]
attr_reader :actualEncoding
# Set width [Integer]
attr_reader :setWidth
# Actual set width [Integer]
attr_reader :actualSetWidth
# 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.
# The font name may be comprised of a family name and optional foundry name enclosed in
# square brackets, for example, "helvetica [bitstream]".
#
# ==== 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
#
# Construct a font with given font description of the form:
#
# fontname [ "[" foundry "]" ] ["," size ["," weight ["," slant ["," setwidth ["," encoding ["," hints]]]]]]
#
# For example:
#
# "helvetica [bitstream],12,bold,i,normal,iso8859-1,0"
#
# Typically, at least the font name, and size must be given for
# normal font matching. As a special case, raw X11 fonts can also be
# passed, for example:
#
# "9x15bold"
#
# Finally, an old FOX 1.0 style font string may be passed as well:
#
# "[helvetica] 90 700 1 1 0 0"
#
def initialize(a, string) # :yields: theFont
end
#
# Change the font to the specified font description string.
# Returns +true+ on success.
#
def setFont(string); end
#
# Return the font description as a string suitable for
# parsing with #setFont, see above.
#
def getFont(); 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