Class: Wx::FontInfo
- Inherits:
-
Object
- Object
- Wx::FontInfo
- Defined in:
- lib/wx/doc/gen/font.rb
Overview
This class is untracked and should not be derived from nor instances extended!
This class is a helper used for Font creation using named parameter idiom: it allows specifying various Font attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to Font constructors.
For example, to create an italic font with the given face name and size you could use:
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.
Class Method Summary collapse
-
.get_weight_closest_to_numeric_value(numWeight) ⇒ Wx::FontWeight
Get the symbolic weight closest to the given raw weight value.
Instance Method Summary collapse
-
#all_flags(flags) ⇒ Wx::FontInfo
Set all the font attributes at once.
-
#anti_aliased(antiAliased = true) ⇒ Wx::FontInfo
Set anti-aliasing flag.
-
#bold(bold = true) ⇒ Wx::FontInfo
Use a bold version of the font.
-
#encoding(encoding) ⇒ Wx::FontInfo
Set the font encoding to use.
-
#face_name(faceName) ⇒ Wx::FontInfo
Set the font face name to use.
-
#family(family) ⇒ Wx::FontInfo
Set the font family.
-
#initialize(*args) ⇒ FontInfo
constructor
A new instance of FontInfo.
-
#italic(italic = true) ⇒ Wx::FontInfo
Use an italic version of the font.
-
#light(light = true) ⇒ Wx::FontInfo
Use a lighter version of the font.
-
#slant(slant = true) ⇒ Wx::FontInfo
Use a slanted version of the font.
-
#strikethrough(strikethrough = true) ⇒ Wx::FontInfo
Use a strike-through version of the font.
-
#style(style) ⇒ Wx::FontInfo
Specify the style of the font using one of FontStyle constants.
-
#underlined(underlined = true) ⇒ Wx::FontInfo
Use an underlined version of the font.
-
#weight(weight) ⇒ Wx::FontInfo
Specify the weight of the font.
Constructor Details
#initialize ⇒ Wx::FontInfo #initialize(pointSize) ⇒ Wx::FontInfo #initialize(pixelSize) ⇒ Wx::FontInfo
Returns a new instance of FontInfo.
1266 |
# File 'lib/wx/doc/gen/font.rb', line 1266 def initialize(*args) end |
Class Method Details
.get_weight_closest_to_numeric_value(numWeight) ⇒ Wx::FontWeight
Get the symbolic weight closest to the given raw weight value.
A valid element of Wx::FontWeight enum.
1373 |
# File 'lib/wx/doc/gen/font.rb', line 1373 def self.get_weight_closest_to_numeric_value(numWeight) end |
Instance Method Details
#all_flags(flags) ⇒ Wx::FontInfo
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.
1366 |
# File 'lib/wx/doc/gen/font.rb', line 1366 def all_flags(flags) end |
#anti_aliased(antiAliased = true) ⇒ Wx::FontInfo
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.
1337 |
# File 'lib/wx/doc/gen/font.rb', line 1337 def anti_aliased(antiAliased=true) end |
#bold(bold = true) ⇒ Wx::FontInfo
Use a bold version of the font.
This is a wrapper for #weight calling it with Wx::FontWeight::FONTWEIGHT_BOLD argument.
1297 |
# File 'lib/wx/doc/gen/font.rb', line 1297 def bold(bold=true) end |
#encoding(encoding) ⇒ Wx::FontInfo
Set the font encoding to use.
This is mostly unneeded in Unicode builds of wxWidgets.
1358 |
# File 'lib/wx/doc/gen/font.rb', line 1358 def encoding(encoding) end |
#face_name(faceName) ⇒ Wx::FontInfo
Set the font face name to use.
Face names are not portable, so prefer to use #family in portable code.
1283 |
# File 'lib/wx/doc/gen/font.rb', line 1283 def face_name(faceName) end |
#family(family) ⇒ Wx::FontInfo
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 #face_name is used, then it overrides the font family.
1275 |
# File 'lib/wx/doc/gen/font.rb', line 1275 def family(family) end |
#italic(italic = true) ⇒ Wx::FontInfo
Use an italic version of the font.
This is a wrapper for #style calling it with Wx::FontStyle::FONTSTYLE_ITALIC argument.
1315 |
# File 'lib/wx/doc/gen/font.rb', line 1315 def italic(italic=true) end |
#light(light = true) ⇒ Wx::FontInfo
Use a lighter version of the font.
This is a wrapper for #weight calling it with Wx::FontWeight::FONTWEIGHT_LIGHT argument.
1306 |
# File 'lib/wx/doc/gen/font.rb', line 1306 def light(light=true) end |
#slant(slant = true) ⇒ Wx::FontInfo
Use a slanted version of the font.
This is a wrapper for #style calling it with Wx::FontStyle::FONTSTYLE_SLANT argument.
1324 |
# File 'lib/wx/doc/gen/font.rb', line 1324 def slant(slant=true) end |
#strikethrough(strikethrough = true) ⇒ Wx::FontInfo
Use a strike-through version of the font.
Currently this is only implemented in WXMSW, WXGTK, and WXOSX.
1349 |
# File 'lib/wx/doc/gen/font.rb', line 1349 def strikethrough(strikethrough=true) end |
#style(style) ⇒ Wx::FontInfo
Specify the style of the font using one of Wx::FontStyle constants.
1329 |
# File 'lib/wx/doc/gen/font.rb', line 1329 def style(style) end |
#underlined(underlined = true) ⇒ Wx::FontInfo
Use an underlined version of the font.
1342 |
# File 'lib/wx/doc/gen/font.rb', line 1342 def underlined(underlined=true) end |
#weight(weight) ⇒ Wx::FontInfo
Specify the weight of the font.
1288 |
# File 'lib/wx/doc/gen/font.rb', line 1288 def weight(weight) end |