# :stopdoc:
# This file is automatically generated by the WXRuby3 documentation
# generator. Do not alter this file.
# :startdoc:
module Wx
# Standard font families: these are used mainly during {Wx::Font} creation to specify the generic properties of the font without hardcoding in the sources a specific face name.
#
# {Wx::FontFamily} thus allows grouping the font face names of fonts with similar properties. Most wxWidgets ports use lists of fonts for each font family inspired by the data taken from http://www.codestyle.org/css/font-family.
#
class FontFamily < Wx::Enum
# Chooses a default font.
#
FONTFAMILY_DEFAULT = Wx::FontFamily.new(70)
# A decorative font.
#
FONTFAMILY_DECORATIVE = Wx::FontFamily.new(71)
# A formal, serif font.
#
FONTFAMILY_ROMAN = Wx::FontFamily.new(72)
# A handwriting font.
#
FONTFAMILY_SCRIPT = Wx::FontFamily.new(73)
# A sans-serif font.
#
FONTFAMILY_SWISS = Wx::FontFamily.new(74)
# A fixed pitch font.
#
FONTFAMILY_MODERN = Wx::FontFamily.new(75)
# A teletype (i.e. monospaced) font.
#
FONTFAMILY_TELETYPE = Wx::FontFamily.new(76)
#
#
FONTFAMILY_MAX = Wx::FontFamily.new(77)
# Invalid font family value, returned by {Wx::Font#get_family} when the font is invalid for example.
#
FONTFAMILY_UNKNOWN = Wx::FontFamily.new(77)
end # FontFamily
# Font styles.
#
#
#
class FontStyle < Wx::Enum
# The font is drawn without slant.
#
FONTSTYLE_NORMAL = Wx::FontStyle.new(90)
# The font is slanted in an italic style.
#
FONTSTYLE_ITALIC = Wx::FontStyle.new(93)
# The font is slanted, but in a roman style.
#
FONTSTYLE_SLANT = Wx::FontStyle.new(94)
#
#
FONTSTYLE_MAX = Wx::FontStyle.new(95)
end # FontStyle
# Font weights.
#
# The values of this enum correspond to the CSS font weight specifications, see https://www.w3.org/TR/css-fonts-4/#font-weight-prop, with the addition of one font weight bolder than heavy
#
class FontWeight < Wx::Enum
# Invalid font weight.
#
FONTWEIGHT_INVALID = Wx::FontWeight.new(0)
# Thin font (weight = 100).
#
FONTWEIGHT_THIN = Wx::FontWeight.new(100)
# Extra Light (Ultra Light) font (weight = 200).
#
FONTWEIGHT_EXTRALIGHT = Wx::FontWeight.new(200)
# Light font (weight = 300).
#
FONTWEIGHT_LIGHT = Wx::FontWeight.new(300)
# Normal font (weight = 400).
#
FONTWEIGHT_NORMAL = Wx::FontWeight.new(400)
# Medium font (weight = 500).
#
FONTWEIGHT_MEDIUM = Wx::FontWeight.new(500)
# Semi Bold (Demi Bold) font (weight = 600).
#
FONTWEIGHT_SEMIBOLD = Wx::FontWeight.new(600)
# Bold font (weight = 700).
#
FONTWEIGHT_BOLD = Wx::FontWeight.new(700)
# Extra Bold (Ultra Bold) font (weight = 800).
#
FONTWEIGHT_EXTRABOLD = Wx::FontWeight.new(800)
# Heavy (Black) font (weight = 900).
#
FONTWEIGHT_HEAVY = Wx::FontWeight.new(900)
# Extra Heavy font (weight = 1000).
#
FONTWEIGHT_EXTRAHEAVY = Wx::FontWeight.new(1000)
#
#
FONTWEIGHT_MAX = Wx::FontWeight.new(1000)
end # FontWeight
# Symbolic font sizes.
#
# The elements of this enum correspond to CSS absolute size specifications, see http://www.w3.org/TR/CSS21/fonts.html#font-size-props
# @see Wx::Font#set_symbolic_size
#
#
class FontSymbolicSize < Wx::Enum
# Extra small.
#
FONTSIZE_XX_SMALL = Wx::FontSymbolicSize.new(-3)
# Very small.
#
FONTSIZE_X_SMALL = Wx::FontSymbolicSize.new(-2)
# Small.
#
FONTSIZE_SMALL = Wx::FontSymbolicSize.new(-1)
# Normal.
#
FONTSIZE_MEDIUM = Wx::FontSymbolicSize.new(0)
# Large.
#
FONTSIZE_LARGE = Wx::FontSymbolicSize.new(1)
# Very large.
#
FONTSIZE_X_LARGE = Wx::FontSymbolicSize.new(2)
# Extra large.
#
FONTSIZE_XX_LARGE = Wx::FontSymbolicSize.new(3)
end # FontSymbolicSize
# The font flag bits for the new font ctor accepting one combined flags word.
#
#
#
class FontFlag < Wx::Enum
# no special flags: font with default weight/slant/anti-aliasing
#
FONTFLAG_DEFAULT = Wx::FontFlag.new(0)
# slant flags (default: no slant)
#
FONTFLAG_ITALIC = Wx::FontFlag.new(1)
#
#
FONTFLAG_SLANT = Wx::FontFlag.new(2)
# weight flags (default: medium)
#
FONTFLAG_LIGHT = Wx::FontFlag.new(4)
#
#
FONTFLAG_BOLD = Wx::FontFlag.new(8)
# anti-aliasing flag: force on or off (default: the current system default)
#
FONTFLAG_ANTIALIASED = Wx::FontFlag.new(16)
#
#
FONTFLAG_NOT_ANTIALIASED = Wx::FontFlag.new(32)
# Underlined style (not underlined by default).
#
FONTFLAG_UNDERLINED = Wx::FontFlag.new(64)
# Strike-through style (implemented in MSW, GTK, and wxOSX)
#
FONTFLAG_STRIKETHROUGH = Wx::FontFlag.new(128)
# the mask of all currently used flags
#
FONTFLAG_MASK = Wx::FontFlag.new(255)
end # FontFlag
# Font encodings.
#
# See {Wx::Font#set_encoding}.
#
class FontEncoding < Wx::Enum
# Default system encoding.
#
FONTENCODING_SYSTEM = Wx::FontEncoding.new(-1)
# Default application encoding: this is the encoding set by calls to {Wx::Font.set_default_encoding}.
#
FONTENCODING_DEFAULT = Wx::FontEncoding.new(0)
# West European (Latin1)
#
FONTENCODING_ISO8859_1 = Wx::FontEncoding.new(1)
# Central and East European (Latin2)
#
FONTENCODING_ISO8859_2 = Wx::FontEncoding.new(2)
# Esperanto (Latin3)
#
FONTENCODING_ISO8859_3 = Wx::FontEncoding.new(3)
# Baltic (old) (Latin4)
#
FONTENCODING_ISO8859_4 = Wx::FontEncoding.new(4)
# Cyrillic.
#
FONTENCODING_ISO8859_5 = Wx::FontEncoding.new(5)
# Arabic.
#
FONTENCODING_ISO8859_6 = Wx::FontEncoding.new(6)
# Greek.
#
FONTENCODING_ISO8859_7 = Wx::FontEncoding.new(7)
# Hebrew.
#
FONTENCODING_ISO8859_8 = Wx::FontEncoding.new(8)
# Turkish (Latin5)
#
FONTENCODING_ISO8859_9 = Wx::FontEncoding.new(9)
# Variation of Latin4 (Latin6)
#
FONTENCODING_ISO8859_10 = Wx::FontEncoding.new(10)
# Thai.
#
FONTENCODING_ISO8859_11 = Wx::FontEncoding.new(11)
# doesn't exist currently, but put it here anyhow to make all ISO8859 consecutive numbers
#
FONTENCODING_ISO8859_12 = Wx::FontEncoding.new(12)
# Baltic (Latin7)
#
FONTENCODING_ISO8859_13 = Wx::FontEncoding.new(13)
# Latin8.
#
FONTENCODING_ISO8859_14 = Wx::FontEncoding.new(14)
# Latin9 (a.k.a. Latin0, includes euro)
#
FONTENCODING_ISO8859_15 = Wx::FontEncoding.new(15)
#
#
FONTENCODING_ISO8859_MAX = Wx::FontEncoding.new(16)
# KOI8 Russian.
#
FONTENCODING_KOI8 = Wx::FontEncoding.new(17)
# KOI8 Ukrainian.
#
FONTENCODING_KOI8_U = Wx::FontEncoding.new(18)
# same as MS-DOS CP866
#
FONTENCODING_ALTERNATIVE = Wx::FontEncoding.new(19)
# used under Linux in Bulgaria
#
FONTENCODING_BULGARIAN = Wx::FontEncoding.new(20)
# original MS-DOS codepage
#
FONTENCODING_CP437 = Wx::FontEncoding.new(21)
# CP437 merged with Latin1.
#
FONTENCODING_CP850 = Wx::FontEncoding.new(22)
# CP437 merged with Latin2.
#
FONTENCODING_CP852 = Wx::FontEncoding.new(23)
# another cyrillic encoding
#
FONTENCODING_CP855 = Wx::FontEncoding.new(24)
# and another one
#
FONTENCODING_CP866 = Wx::FontEncoding.new(25)
# WinThai.
#
FONTENCODING_CP874 = Wx::FontEncoding.new(26)
# Japanese (shift-JIS)
#
FONTENCODING_CP932 = Wx::FontEncoding.new(27)
# Chinese simplified (GB)
#
FONTENCODING_CP936 = Wx::FontEncoding.new(28)
# Korean (Hangul charset)
#
FONTENCODING_CP949 = Wx::FontEncoding.new(29)
# Chinese (traditional - Big5)
#
FONTENCODING_CP950 = Wx::FontEncoding.new(30)
# WinLatin2.
#
FONTENCODING_CP1250 = Wx::FontEncoding.new(31)
# WinCyrillic.
#
FONTENCODING_CP1251 = Wx::FontEncoding.new(32)
# WinLatin1.
#
FONTENCODING_CP1252 = Wx::FontEncoding.new(33)
# WinGreek (8859-7)
#
FONTENCODING_CP1253 = Wx::FontEncoding.new(34)
# WinTurkish.
#
FONTENCODING_CP1254 = Wx::FontEncoding.new(35)
# WinHebrew.
#
FONTENCODING_CP1255 = Wx::FontEncoding.new(36)
# WinArabic.
#
FONTENCODING_CP1256 = Wx::FontEncoding.new(37)
# WinBaltic (same as Latin 7)
#
FONTENCODING_CP1257 = Wx::FontEncoding.new(38)
# WinVietnamese (since 2.9.4)
#
FONTENCODING_CP1258 = Wx::FontEncoding.new(39)
# Johab Korean character set (since 2.9.4)
#
FONTENCODING_CP1361 = Wx::FontEncoding.new(40)
#
#
FONTENCODING_CP12_MAX = Wx::FontEncoding.new(41)
# UTF-7 Unicode encoding.
#
FONTENCODING_UTF7 = Wx::FontEncoding.new(42)
# UTF-8 Unicode encoding.
#
FONTENCODING_UTF8 = Wx::FontEncoding.new(43)
# Extended Unix Codepage for Japanese.
#
FONTENCODING_EUC_JP = Wx::FontEncoding.new(44)
# UTF-16 Big Endian Unicode encoding.
#
FONTENCODING_UTF16BE = Wx::FontEncoding.new(45)
# UTF-16 Little Endian Unicode encoding.
#
FONTENCODING_UTF16LE = Wx::FontEncoding.new(46)
# UTF-32 Big Endian Unicode encoding.
#
FONTENCODING_UTF32BE = Wx::FontEncoding.new(47)
#
#
FONTENCODING_UTF32LE = Wx::FontEncoding.new(48)
# the standard mac encodings
#
FONTENCODING_MACROMAN = Wx::FontEncoding.new(49)
#
#
FONTENCODING_MACJAPANESE = Wx::FontEncoding.new(50)
#
#
FONTENCODING_MACCHINESETRAD = Wx::FontEncoding.new(51)
#
#
FONTENCODING_MACKOREAN = Wx::FontEncoding.new(52)
#
#
FONTENCODING_MACARABIC = Wx::FontEncoding.new(53)
#
#
FONTENCODING_MACHEBREW = Wx::FontEncoding.new(54)
#
#
FONTENCODING_MACGREEK = Wx::FontEncoding.new(55)
#
#
FONTENCODING_MACCYRILLIC = Wx::FontEncoding.new(56)
#
#
FONTENCODING_MACDEVANAGARI = Wx::FontEncoding.new(57)
#
#
FONTENCODING_MACGURMUKHI = Wx::FontEncoding.new(58)
#
#
FONTENCODING_MACGUJARATI = Wx::FontEncoding.new(59)
#
#
FONTENCODING_MACORIYA = Wx::FontEncoding.new(60)
#
#
FONTENCODING_MACBENGALI = Wx::FontEncoding.new(61)
#
#
FONTENCODING_MACTAMIL = Wx::FontEncoding.new(62)
#
#
FONTENCODING_MACTELUGU = Wx::FontEncoding.new(63)
#
#
FONTENCODING_MACKANNADA = Wx::FontEncoding.new(64)
#
#
FONTENCODING_MACMALAJALAM = Wx::FontEncoding.new(65)
#
#
FONTENCODING_MACSINHALESE = Wx::FontEncoding.new(66)
#
#
FONTENCODING_MACBURMESE = Wx::FontEncoding.new(67)
#
#
FONTENCODING_MACKHMER = Wx::FontEncoding.new(68)
#
#
FONTENCODING_MACTHAI = Wx::FontEncoding.new(69)
#
#
FONTENCODING_MACLAOTIAN = Wx::FontEncoding.new(70)
#
#
FONTENCODING_MACGEORGIAN = Wx::FontEncoding.new(71)
#
#
FONTENCODING_MACARMENIAN = Wx::FontEncoding.new(72)
#
#
FONTENCODING_MACCHINESESIMP = Wx::FontEncoding.new(73)
#
#
FONTENCODING_MACTIBETAN = Wx::FontEncoding.new(74)
#
#
FONTENCODING_MACMONGOLIAN = Wx::FontEncoding.new(75)
#
#
FONTENCODING_MACETHIOPIC = Wx::FontEncoding.new(76)
#
#
FONTENCODING_MACCENTRALEUR = Wx::FontEncoding.new(77)
#
#
FONTENCODING_MACVIATNAMESE = Wx::FontEncoding.new(78)
#
#
FONTENCODING_MACARABICEXT = Wx::FontEncoding.new(79)
#
#
FONTENCODING_MACSYMBOL = Wx::FontEncoding.new(80)
#
#
FONTENCODING_MACDINGBATS = Wx::FontEncoding.new(81)
#
#
FONTENCODING_MACTURKISH = Wx::FontEncoding.new(82)
#
#
FONTENCODING_MACCROATIAN = Wx::FontEncoding.new(83)
#
#
FONTENCODING_MACICELANDIC = Wx::FontEncoding.new(84)
#
#
FONTENCODING_MACROMANIAN = Wx::FontEncoding.new(85)
#
#
FONTENCODING_MACCELTIC = Wx::FontEncoding.new(86)
#
#
FONTENCODING_MACGAELIC = Wx::FontEncoding.new(87)
#
#
FONTENCODING_MACKEYBOARD = Wx::FontEncoding.new(88)
# ISO-2022-JP JIS encoding.
#
FONTENCODING_ISO2022_JP = Wx::FontEncoding.new(89)
# highest enumerated encoding value
#
FONTENCODING_MAX = Wx::FontEncoding.new(90)
#
#
FONTENCODING_MACMIN = Wx::FontEncoding.new(49)
#
#
FONTENCODING_MACMAX = Wx::FontEncoding.new(88)
# native UTF-16
#
FONTENCODING_UTF16 = Wx::FontEncoding.new(46)
# native UTF-32
#
FONTENCODING_UTF32 = Wx::FontEncoding.new(48)
# Alias for the native Unicode encoding on this platform (this is used by {Wx::EncodingConverter} and {Wx::UTFFile} only for now)
#
FONTENCODING_UNICODE = Wx::FontEncoding.new(46)
# Simplified Chinese.
#
FONTENCODING_GB2312 = Wx::FontEncoding.new(28)
# Traditional Chinese.
#
FONTENCODING_BIG5 = Wx::FontEncoding.new(30)
# Shift JIS.
#
FONTENCODING_SHIFT_JIS = Wx::FontEncoding.new(27)
# Korean.
#
FONTENCODING_EUC_KR = Wx::FontEncoding.new(29)
# Korean Johab (since 2.9.4)
#
FONTENCODING_JOHAB = Wx::FontEncoding.new(40)
# Vietnamese (since 2.9.4)
#
FONTENCODING_VIETNAMESE = Wx::FontEncoding.new(39)
end # FontEncoding
# An empty {Wx::Font}.
#
NULL_FONT = nil
# A font is an object which determines the appearance of text.
# Fonts are used for drawing text to a device context, and setting the appearance of a window's text, see {Wx::DC#set_font} and {Wx::Window#set_font}.
# The easiest way to create a custom font is to use {Wx::FontInfo} object to specify the font attributes and then use wxFont::wxFont(const wxFontInfo&) constructor. Alternatively, you could start with one of the pre-defined fonts or use {Wx::Window#get_font} and modify the font, e.g. by increasing its size using {Wx::Font#make_larger} or changing its weight using {Wx::Font#make_bold}.
# This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected.
# You can retrieve the current system font settings with {Wx::SystemSettings}.
# ===
#
# Category: Graphics Device Interface (GDI)
# Predefined objects/pointers: {Wx::NULL_FONT}, {Wx::NORMAL_FONT}, {Wx::SMALL_FONT}, {Wx::ITALIC_FONT}, {Wx::SWISS_FONT}
# @see wxFont Overview
# @see Wx::DC#set_font
# @see Wx::DC#draw_text
# @see Wx::DC#get_text_extent
# @see Wx::FontDialog
# @see Wx::SystemSettings
#
#
#
# @note This class is untracked and should not be derived from nor instances extended!
class Font < GDIObject
# Returns a font with the same face/size as the given one but with normal weight and style and not underlined nor stricken through.
# @return [Wx::Font]
def get_base_font; end
alias_method :base_font, :get_base_font
# Returns the encoding of this font.
# Note that under wxGTK the returned value is always {Wx::FontEncoding::FONTENCODING_UTF8}.
# @see Wx::Font#set_encoding
# @return [Wx::FontEncoding]
def get_encoding; end
alias_method :encoding, :get_encoding
# Returns the face name associated with the font, or the empty string if there is no face information.
#
# @see Wx::Font#set_face_name
# @return [String]
def get_face_name; end
alias_method :face_name, :get_face_name
# Gets the font family if possible.
# As described in {Wx::FontFamily} docs the returned value acts as a rough, basic classification of the main font properties (look, spacing).
# If the current font face name is not recognized by {Wx::Font} or by the underlying system, {Wx::FontFamily::FONTFAMILY_DEFAULT} is returned.
# Note that currently this function is not very precise and so not particularly useful. Font families mostly make sense only for font creation, see {Wx::Font#set_family}.
# @see Wx::Font#set_family
# @return [Wx::FontFamily]
def get_family; end
alias_method :family, :get_family
# Returns the platform-dependent string completely describing this font.
# Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).
# Note that the returned string is not meant to be shown or edited by the user: a typical use of this function is for serializing in string-form a {Wx::Font} object.
# @see Wx::Font#set_native_font_info
# @see Wx::Font#get_native_font_info_user_desc
# @return [String]
def get_native_font_info_desc; end
alias_method :native_font_info_desc, :get_native_font_info_desc
# Returns a user-friendly string for this font object.
# Returned string is always non-empty unless the font is invalid (in which case an assert is triggered).
# The string does not encode all {Wx::Font} infos under all platforms; e.g. under wxMSW the font family is not present in the returned string.
# Some examples of the formats of returned strings (which are platform-dependent) are in {Wx::Font#set_native_font_info_user_desc}.
# @see Wx::Font#set_native_font_info_user_desc
# @see Wx::Font#get_native_font_info_desc
# @return [String]
def get_native_font_info_user_desc; end
alias_method :native_font_info_user_desc, :get_native_font_info_user_desc
# Gets the point size as an integer number.
# This function is kept for compatibility reasons. New code should use {Wx::Font#get_fractional_point_size} and support fractional point sizes.
# @see Wx::Font#set_point_size
# @see
#
# @see Wx::Font#get_fractional_point_size
# @return [Integer]
def get_point_size; end
alias_method :point_size, :get_point_size
# Gets the point size as a floating number.
#
# @see SetPointSize(float)
# @return [Float]
def get_fractional_point_size; end
alias_method :fractional_point_size, :get_fractional_point_size
# Gets the pixel size.
# Note that under wxMSW if you passed to {Wx::Font#set_pixel_size} (or to the ctor) a {Wx::Size} object with a null width value, you'll get a null width in the returned object.
# @see Wx::Font#set_pixel_size
# @return [Wx::Size]
def get_pixel_size; end
alias_method :pixel_size, :get_pixel_size
# Gets the font style.
# See {Wx::FontStyle} for a list of valid styles.
# @see Wx::Font#set_style
# @return [Wx::FontStyle]
def get_style; end
alias_method :style, :get_style
# Returns true if the font is underlined, false otherwise.
#
# @see Wx::Font#set_underlined
# @return [Boolean]
def get_underlined; end
# Returns true if the font is stricken-through, false otherwise.
#
# @see Wx::Font#set_strikethrough
# @return [Boolean]
def get_strikethrough; end
# Gets the font weight.
# See {Wx::FontWeight} for a list of valid weight identifiers.
# @see Wx::Font#set_weight
# @return [Wx::FontWeight]
def get_weight; end
alias_method :weight, :get_weight
# Gets the font weight as an integer value.
# See {Wx::FontWeight} for a list of valid weight identifiers and their corresponding integer value.
# @see Wx::Font#set_weight
#
# @see Wx::Font#set_numeric_weight
# @return [Integer]
def get_numeric_weight; end
alias_method :numeric_weight, :get_numeric_weight
# Returns true if the font is a fixed width (or monospaced) font, false if it is a proportional one or font is invalid.
# Note that this function under some platforms is different from just testing for the font family being equal to {Wx::FontFamily::FONTFAMILY_TELETYPE} because native platform-specific functions are used for the check (resulting in a more accurate return value).
# @return [Boolean]
def is_fixed_width; end
alias_method :fixed_width?, :is_fixed_width
# Returns true if this object is a valid font, false otherwise.
# @return [Boolean]
def is_ok; end
alias_method :ok?, :is_ok
# Specify the name of a file containing a TrueType font to be made available to the current application.
# This method can be used to allow this application to use the font from the given file even if it is not globally installed on the system.
# Under macOS this method actually doesn't do anything other than check for the existence of the file in the "Fonts" subdirectory of the application bundle "Resources" directory. You are responsible for actually making the font file available in this directory and setting ATSApplicationFontsPath to Fonts value in your Info.plist file. See also {Wx::StandardPaths#get_resources_dir}.
# Under MSW this method must be called before any {Wx::GraphicsContext} objects have been created, otherwise the private font won't be usable from them.
# Under Unix this method requires Pango 1.38 or later and will return false and log an error message explaining the problem if this requirement is not satisfied either at compile- or run-time.
# Currently this method is implemented for all major platforms (subject to having Pango 1.38 or later when running configure under Unix) and {Wx::Setup::USE_PRIVATE_FONTS} is always set to 0 under the other platforms, making this function unavailable at compile-time.
# true if the font was added and can now be used.
# @param filename [String]
# @return [Boolean]
def self.add_private_font(filename) end
# Returns a bold version of this font.
#
# @see Wx::Font#make_bold
# @return [Wx::Font]
def bold; end
# Returns an italic version of this font.
#
# @see Wx::Font#make_italic
# @return [Wx::Font]
def italic; end
# Returns a larger version of this font.
# The font size is multiplied by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.
# @see Wx::Font#make_larger
# @see Wx::Font#smaller
# @see Wx::Font#scaled
# @return [Wx::Font]
def larger; end
# Returns a smaller version of this font.
# The font size is divided by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.
# @see Wx::Font#make_smaller
# @see Wx::Font#larger
# @see Wx::Font#scaled
# @return [Wx::Font]
def smaller; end
# Returns underlined version of this font.
#
# @see Wx::Font#make_underlined
# @return [Wx::Font]
def underlined; end
# Returns stricken-through version of this font.
# Currently stricken-through fonts are only supported in wxMSW, wxGTK, and wxOSX.
# @see Wx::Font#make_strikethrough
# @return [Wx::Font]
def strikethrough; end
# Changes this font to be bold.
#
# @see Wx::Font#bold
# @return [Wx::Font]
def make_bold; end
# Changes this font to be italic.
#
# @see Wx::Font#italic
# @return [Wx::Font]
def make_italic; end
# Changes this font to be larger.
# The font size is multiplied by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.
# @see Wx::Font#larger
# @see Wx::Font#make_smaller
# @see Wx::Font#scale
# @return [Wx::Font]
def make_larger; end
# Changes this font to be smaller.
# The font size is divided by 1.2, the factor of 1.2 being inspired by the W3C CSS specification.
# @see Wx::Font#smaller
# @see Wx::Font#make_larger
# @see Wx::Font#scale
# @return [Wx::Font]
def make_smaller; end
# Changes this font to be underlined.
#
# @see Wx::Font#underlined
# @return [Wx::Font]
def make_underlined; end
# Changes this font to be stricken-through.
# Currently stricken-through fonts are only supported in wxMSW, wxGTK, and wxOSX.
# @see Wx::Font#strikethrough
# @return [Wx::Font]
def make_strikethrough; end
# Changes the size of this font.
# The font size is multiplied by the given factor (which may be less than 1 to create a smaller version of the font).
# @see Wx::Font#scaled
# @see Wx::Font#make_larger
# @see Wx::Font#make_smaller
# @param x [Float]
# @return [Wx::Font]
def scale(x) end
# Returns a scaled version of this font.
# The font size is multiplied by the given factor (which may be less than 1 to create a smaller version of the font).
# @see Wx::Font#scale
# @see Wx::Font#larger
# @see Wx::Font#smaller
# @param x [Float]
# @return [Wx::Font]
def scaled(x) end
# Sets the encoding for this font.
# Note that under wxGTK this function has no effect (because the underlying Pango library always uses {Wx::FontEncoding::FONTENCODING_UTF8}).
# @see Wx::Font#get_encoding
# @param encoding [Wx::FontEncoding]
# @return [void]
def set_encoding(encoding) end
alias_method :encoding=, :set_encoding
# Sets the facename for the font.
# To avoid portability problems, don't rely on a specific face, but specify the font family instead (see {Wx::FontFamily} and {Wx::Font#set_family}).
#
# true if the given face name exists; if the face name doesn't exist in the user's system then the font is invalidated (so that {Wx::Font#is_ok} will return false) and false is returned.
# @see Wx::Font#get_face_name
# @see Wx::Font#set_family
# @param faceName [String] A valid facename, which should be on the end-user's system.
# @return [Boolean]
def set_face_name(faceName) end
alias_method :face_name=, :set_face_name
# Sets the font family.
# As described in {Wx::FontFamily} docs the given family value acts as a rough, basic indication of the main font properties (look, spacing).
# Note that changing the font family results in changing the font face name.
# @see Wx::Font#get_family
# @see Wx::Font#set_face_name
# @param family [Wx::FontFamily] One of the {Wx::FontFamily} values.
# @return [void]
def set_family(family) end
alias_method :family=, :set_family
# Creates the font corresponding to the given native font description string which must have been previously returned by {Wx::Font#get_native_font_info_desc}.
# If the string is invalid, font is unchanged. This function is typically used for de-serializing a {Wx::Font} object previously saved in a string-form.
# true if the creation was successful.
# @see Wx::Font#set_native_font_info_user_desc
# @param info [String]
# @return [Boolean]
def set_native_font_info(info) end
alias_method :native_font_info=, :set_native_font_info
# Creates the font corresponding to the given native font description string and returns true if the creation was successful.
# Unlike {Wx::Font#set_native_font_info}, this function accepts strings which are user-friendly. Examples of accepted string formats are:
#
# platform
# generic syntax
# example
#
# wxGTK2
# [underlined] [strikethrough] [FACE-NAME] [bold] [oblique|italic] [POINTSIZE]
# Monospace bold 10
#
# wxMSW
# [light|bold] [italic] [FACE-NAME] [POINTSIZE] [ENCODING]
# Tahoma 10 WINDOWS-1252
#
# Todoadd an example for wxMac
#
# For more detailed information about the allowed syntaxes you can look at the documentation of the native API used for font-rendering (e.g. pango_font_description_from_string under GTK, although notice that it doesn't support the "underlined" and "strikethrough" attributes and so those are handled by wxWidgets itself).
# Note that unlike {Wx::Font#set_native_font_info}, this function doesn't always restore all attributes of the {Wx::Font} object under all platforms; e.g. on wxMSW the font family is not restored (because GetNativeFontInfoUserDesc doesn't return it on wxMSW). If you want to serialize/deserialize a font in string form, you should use {Wx::Font#get_native_font_info_desc} and {Wx::Font#set_native_font_info} instead.
# @see Wx::Font#set_native_font_info
# @param info [String]
# @return [Boolean]
def set_native_font_info_user_desc(info) end
alias_method :native_font_info_user_desc=, :set_native_font_info_user_desc
# Sets the font size in points to an integer value.
# This is a legacy version of the function only supporting integer point sizes. It can still be used, but to avoid unnecessarily restricting the font size in points to integer values, consider using the new (added in wxWidgets 3.1.2) {Wx::Font#set_fractional_point_size} function instead.
# @param pointSize [Integer]
# @return [void]
def set_point_size(pointSize) end
alias_method :point_size=, :set_point_size
# Sets the font size in points.
# The point size is defined as 1/72 of the Anglo-Saxon inch (25.4 mm): it is approximately 0.0139 inch or 352.8 um.
# @see Wx::Font#get_fractional_point_size
# @see Wx::Font#set_point_size
# @param pointSize [Float] Size in points. This can also be a fractional point size like 11.5.
# @return [void]
def set_fractional_point_size(pointSize) end
alias_method :fractional_point_size=, :set_fractional_point_size
# Sets the pixel size.
# The height parameter of pixelSize must be positive while the width parameter may also be zero (to indicate that you're not interested in the width of the characters: a suitable width will be chosen for best rendering).
# This feature (specifying the font pixel size) is directly supported only under wxMSW and wxGTK currently; under other platforms a font with the closest size to the given one is found using binary search (this maybe slower).
# @see Wx::Font#get_pixel_size
# @param pixelSize [Array(Integer, Integer), Wx::Size]
# @return [void]
def set_pixel_size(pixelSize) end
alias_method :pixel_size=, :set_pixel_size
# Sets the font style.
#
# @see Wx::Font#get_style
# @param style [Wx::FontStyle] One of the {Wx::FontStyle} enumeration values.
# @return [void]
def set_style(style) end
alias_method :style=, :set_style
# Sets the font size using a predefined symbolic size name.
# This function allows changing font size to be (very) large or small compared to the standard font size.
# @see Wx::Font#set_symbolic_size_relative_to.
# @param size [Wx::FontSymbolicSize]
# @return [void]
def set_symbolic_size(size) end
alias_method :symbolic_size=, :set_symbolic_size
# Sets the font size compared to the base font size.
# This is the same as {Wx::Font#set_symbolic_size} except that it uses the given font size as the normal font size instead of the standard font size.
# @param size [Wx::FontSymbolicSize]
# @param base [Integer]
# @return [void]
def set_symbolic_size_relative_to(size, base) end
# Sets underlining.
#
# @see Wx::Font#get_underlined
# @param underlined [Boolean] true to underline, false otherwise.
# @return [void]
def set_underlined(underlined) end
alias_method :underlined=, :set_underlined
# Sets strike-through attribute of the font.
# Currently stricken-through fonts are only supported in wxMSW, wxGTK, and wxOSX.
# @see Wx::Font#get_strikethrough
# @param strikethrough [Boolean] true to add strike-through style, false to remove it.
# @return [void]
def set_strikethrough(strikethrough) end
alias_method :strikethrough=, :set_strikethrough
# Sets the font weight.
#
# @see Wx::Font#get_weight
# @param weight [Wx::FontWeight] One of the {Wx::FontWeight} values.
# @return [void]
def set_weight(weight) end
alias_method :weight=, :set_weight
# Sets the font weight using an integer value.
# See {Wx::FontWeight} for a list of valid weight identifiers and their corresponding integer value.
# @see Wx::Font#get_numeric_weight
# @param weight [Integer] An integer value int the range 1-1000.
# @return [void]
def set_numeric_weight(weight) end
alias_method :numeric_weight=, :set_numeric_weight
# @overload self.create(pointSize, family, style, weight, underline=false, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
# Their use is discouraged, use {Wx::Font} constructor from {Wx::FontInfo} instead.
# @param pointSize [Integer]
# @param family [Wx::FontFamily]
# @param style [Wx::FontStyle]
# @param weight [Wx::FontWeight]
# @param underline [Boolean]
# @param faceName [String]
# @param encoding [Wx::FontEncoding]
# @return [Wx::Font]
# @overload self.create(pointSize, family, flags=Wx::FontFlag::FONTFLAG_DEFAULT, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
# Their use is discouraged, use {Wx::Font} constructor from {Wx::FontInfo} instead.
# @param pointSize [Integer]
# @param family [Wx::FontFamily]
# @param flags [Integer]
# @param faceName [String]
# @param encoding [Wx::FontEncoding]
# @return [Wx::Font]
# @overload self.create(pixelSize, family, style, weight, underline=false, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
# Their use is discouraged, use {Wx::Font} constructor from {Wx::FontInfo} instead.
# @param pixelSize [Array(Integer, Integer), Wx::Size]
# @param family [Wx::FontFamily]
# @param style [Wx::FontStyle]
# @param weight [Wx::FontWeight]
# @param underline [Boolean]
# @param faceName [String]
# @param encoding [Wx::FontEncoding]
# @return [Wx::Font]
# @overload self.create(pixelSize, family, flags=Wx::FontFlag::FONTFLAG_DEFAULT, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
# Their use is discouraged, use {Wx::Font} constructor from {Wx::FontInfo} instead.
# @param pixelSize [Array(Integer, Integer), Wx::Size]
# @param family [Wx::FontFamily]
# @param flags [Integer]
# @param faceName [String]
# @param encoding [Wx::FontEncoding]
# @return [Wx::Font]
# @overload self.create(nativeInfoString)
# This function takes the same parameters as the relative wxFont constructor and returns a new font object allocated on the heap.
# Their use is discouraged, use {Wx::Font} constructor from {Wx::FontInfo} instead.
# @param nativeInfoString [String]
# @return [Wx::Font]
def self.create(*args) end
# @overload initialize()
# Default ctor.
# @return [Wx::Font]
# @overload initialize(font)
# Copy constructor, uses reference counting.
# @param font [Wx::Font,Wx::FontInfo]
# @return [Wx::Font]
# @overload initialize(fontInfo)
# Creates a font object using the specified font description.
# This is the preferred way to create font objects as using this ctor results in more readable code and it is also extensible, e.g. it could continue to be used if support for more font attributes is added in the future. For example, this constructor provides the only way of creating fonts with strike-through style.
# Example of creating a font using this ctor:
# ```ruby
# font = Wx::Font.new(Wx::FontInfo.new(10).bold().underlined())
# ```
# @param fontInfo [Wx::FontInfo]
# @return [Wx::Font]
# @overload initialize(pointSize, family, style, weight, underline=false, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# Creates a font object with the specified attributes and size in points.
# Notice that the use of this constructor is often more verbose and less readable than using wxFont(const wxFontInfo& font), e.g. the example in that constructor documentation would need to be written as:
#
# ```ruby
# font = Wx::Font.new(10, Wx::FontFamily::FONTFAMILY_DEFAULT,
# Wx::FontStyle::FONTSTYLE_NORMAL,
# Wx::FontWeight::FONTWEIGHT_BOLD, true)
# ```
#
# If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.
# @param pointSize [Integer] Size in points. See {Wx::Font#set_point_size} for more info. Notice that, for historical reasons, the value 70 here is interpreted at {Wx::DEFAULT} and results in creation of the font with the default size and not of a font with the size of 70pt. If you really need the latter, please use SetPointSize(70). Note that this constructor and the matching Create() method overload are the only places in {Wx::Font} API handling {Wx::DEFAULT} specially: neither {Wx::Font#set_point_size} nor the constructor taking {Wx::FontInfo} handle this value in this way.
# @param family [Wx::FontFamily] The font family: a generic portable way of referring to fonts without specifying a facename. This parameter must be one of the {Wx::FontFamily} enumeration values. If the faceName argument is provided, then it overrides the font family.
# @param style [Wx::FontStyle] One of {Wx::FontStyle::FONTSTYLE_NORMAL}, {Wx::FontStyle::FONTSTYLE_SLANT} and {Wx::FontStyle::FONTSTYLE_ITALIC}.
# @param weight [Wx::FontWeight] Font weight, sometimes also referred to as font boldness. One of the {Wx::FontWeight} enumeration values.
# @param underline [Boolean] The value can be true or false. At present this has an effect on Windows and Motif 2.x only.
# @param faceName [String] An optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
# @param encoding [Wx::FontEncoding] An encoding which may be one of the enumeration values of {Wx::FontEncoding}. If the specified encoding isn't available, no font is created (see also Font Encodings).
# @return [Wx::Font]
# @overload initialize(pixelSize, family, style, weight, underline=false, faceName=(''), encoding=Wx::FontEncoding::FONTENCODING_DEFAULT)
# Creates a font object with the specified attributes and size in pixels.
# Notice that the use of this constructor is often more verbose and less readable than the use of constructor from {Wx::FontInfo}, consider using that constructor instead.
#
# If the desired font does not exist, the closest match will be chosen. Under Windows, only scalable TrueType fonts are used.
# @param pixelSize [Array(Integer, Integer), Wx::Size] Size in pixels. See {Wx::Font#set_pixel_size} for more info.
# @param family [Wx::FontFamily] The font family: a generic portable way of referring to fonts without specifying a facename. This parameter must be one of the {Wx::FontFamily} enumeration values. If the faceName argument is provided, then it overrides the font family.
# @param style [Wx::FontStyle] One of {Wx::FontStyle::FONTSTYLE_NORMAL}, {Wx::FontStyle::FONTSTYLE_SLANT} and {Wx::FontStyle::FONTSTYLE_ITALIC}.
# @param weight [Wx::FontWeight] Font weight, sometimes also referred to as font boldness. One of the {Wx::FontWeight} enumeration values.
# @param underline [Boolean] The value can be true or false. At present this has an effect on Windows and Motif 2.x only.
# @param faceName [String] An optional string specifying the face name to be used. If it is an empty string, a default face name will be chosen based on the family.
# @param encoding [Wx::FontEncoding] An encoding which may be one of the enumeration values of {Wx::FontEncoding}. If the specified encoding isn't available, no font is created (see also Font Encodings).
# @return [Wx::Font]
# @overload initialize(nativeInfoString)
# Constructor from font description string.
# This constructor uses {Wx::Font#set_native_font_info} to initialize the font. If fontdesc is invalid the font remains uninitialized, i.e. its {Wx::Font#is_ok} method will return false.
# @param nativeInfoString [String]
# @return [Wx::Font]
def initialize(*args) end
# Equality operator.
# See reference-counted object comparison for more info.
# @param font [Wx::Font,Wx::FontInfo]
# @return [Boolean]
def ==(font) end
# Returns the current application's default encoding.
#
# @see Font Encodings
# @see Wx::Font.set_default_encoding
# @return [Wx::FontEncoding]
def self.get_default_encoding; end
# Sets the default font encoding.
#
# @see Font Encodings
# @see Wx::Font.get_default_encoding
# @param encoding [Wx::FontEncoding]
# @return [void]
def self.set_default_encoding(encoding) end
# Get the raw weight value corresponding to the given symbolic constant.
# For compatibility, this function handles the values {Wx::NORMAL}, {Wx::LIGHT} and {Wx::BOLD}, that have values 90, 91 and 92, specially and converts them to the corresponding {Wx::FONTWEIGHT_XXX} weight value.
#
# Numeric weight, between 1 and 1000.
# @param weight [Wx::FontWeight] A valid element of {Wx::FontWeight} enum, i.e. this argument can't have value {Wx::FontWeight::FONTWEIGHT_INVALID}.
# @return [Integer]
def self.get_numeric_weight_of(weight) end
end # Font
# This class is a helper used for {Wx::Font} creation using named parameter idiom: it allows specifying various {Wx::Font} attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to {Wx::Font} constructors.
# For example, to create an italic font with the given face name and size you could use:
# ```ruby
# font = Wx::Font.new(Wx::FontInfo.new(12).face_name('Helvetica').italic())
# ```
#
# Notice that all of the methods of this object return a reference to the object itself, allowing the calls to them to be chained as in the example above.
# All methods taking boolean parameters can be used to turn the specified font attribute on or off and turn it on by default.
#
#
# @note This class is untracked and should not be derived from nor instances extended!
class FontInfo < ::Object
# @overload initialize()
# Default constructor uses the default font size for the current platform.
# @return [Wx::FontInfo]
# @overload initialize(pointSize)
# Constructor setting the font size in points to use.
# Note that until wxWidgets 3.1.2 fractional point sizes were not supported, and the type of pointSize was int.
# @see Wx::Font#set_point_size
# @param pointSize [Float]
# @return [Wx::FontInfo]
# @overload initialize(pixelSize)
# Constructor setting the font size in pixels to use.
#
# @see Wx::Font#set_pixel_size
# @param pixelSize [Array(Integer, Integer), Wx::Size]
# @return [Wx::FontInfo]
def initialize(*args) end
# Set the font family.
# The family is a generic portable way of referring to fonts without specifying a precise face name. This parameter must be one of the {Wx::FontFamily} enumeration values.
# If the {Wx::FontInfo#face_name} is used, then it overrides the font family.
# @see Wx::Font#set_family
# @param family [Wx::FontFamily]
# @return [Wx::FontInfo]
def family(family) end
# Set the font face name to use.
# Face names are not portable, so prefer to use {Wx::FontInfo#family} in portable code.
# @see Wx::Font#set_face_name
# @param faceName [String]
# @return [Wx::FontInfo]
def face_name(faceName) end
# Specify the weight of the font.
# @param weight [Integer] A font weight in the range from 1 to 1000, inclusive, with 1 being the thinnest and 1000 the heaviest possible font variant. {Wx::FONTWEIGHT_XXX} values from {Wx::FontWeight} enum can be used here.
# @return [Wx::FontInfo]
def weight(weight) end
# Use a bold version of the font.
# This is a wrapper for {Wx::FontInfo#weight} calling it with {Wx::FontWeight::FONTWEIGHT_BOLD} argument.
# @see Wx::FontWeight
# @see Wx::Font#set_weight
# @param bold [Boolean]
# @return [Wx::FontInfo]
def bold(bold=true) end
# Use a lighter version of the font.
# This is a wrapper for {Wx::FontInfo#weight} calling it with {Wx::FontWeight::FONTWEIGHT_LIGHT} argument.
# @see Wx::FontWeight
# @see Wx::Font#set_weight
# @param light [Boolean]
# @return [Wx::FontInfo]
def light(light=true) end
# Use an italic version of the font.
# This is a wrapper for {Wx::FontInfo#style} calling it with {Wx::FontStyle::FONTSTYLE_ITALIC} argument.
# @see Wx::FontStyle
# @see Wx::Font#set_style
# @param italic [Boolean]
# @return [Wx::FontInfo]
def italic(italic=true) end
# Use a slanted version of the font.
# This is a wrapper for {Wx::FontInfo#style} calling it with {Wx::FontStyle::FONTSTYLE_SLANT} argument.
# @see Wx::FontStyle
# @see Wx::Font#set_style
# @param slant [Boolean]
# @return [Wx::FontInfo]
def slant(slant=true) end
# Specify the style of the font using one of {Wx::FontStyle} constants.
# @param style [Wx::FontStyle]
# @return [Wx::FontInfo]
def style(style) end
# Set anti-aliasing flag.
# Force the use of anti-aliasing on or off.
# Currently this is not implemented, i.e. using this method doesn't do anything.
# @param antiAliased [Boolean]
# @return [Wx::FontInfo]
def anti_aliased(antiAliased=true) end
# Use an underlined version of the font.
# @param underlined [Boolean]
# @return [Wx::FontInfo]
def underlined(underlined=true) end
# Use a strike-through version of the font.
# Currently this is only implemented in wxMSW, wxGTK, and wxOSX.
# @param strikethrough [Boolean]
# @return [Wx::FontInfo]
def strikethrough(strikethrough=true) end
# Set the font encoding to use.
# This is mostly unneeded in Unicode builds of wxWidgets.
# @see Wx::FontEncoding
# @see Wx::Font#set_encoding
# @param encoding [Wx::FontEncoding]
# @return [Wx::FontInfo]
def encoding(encoding) end
# Set all the font attributes at once.
# See {Wx::FontFlag} for the various flags that can be used.
# Note that calling this method affects the font weight stored in this object: it is set to {Wx::FontWeight::FONTWEIGHT_LIGHT} or {Wx::FontWeight::FONTWEIGHT_BOLD} if the corresponding flag is present in flags, or {Wx::FontWeight::FONTWEIGHT_NORMAL} otherwise.
# @param flags [Integer]
# @return [Wx::FontInfo]
def all_flags(flags) end
# Get the symbolic weight closest to the given raw weight value.
# A valid element of {Wx::FontWeight} enum.
# @param numWeight [Integer] A valid raw weight value, i.e. a value in the range 1 to 1000, inclusive.
# @return [Wx::FontWeight]
def self.get_weight_closest_to_numeric_value(numWeight) end
end # FontInfo
end