Class: UIFont
Overview
The UIFont class provides the interface for getting and setting font information. The class provides you with access to the font’s characteristics and also provides the system with access to the font’s glyph information, which is used during layout. You use font objects by passing them to methods that accept them as a parameter.
Instance Attribute Summary (collapse)
-
- ascender
readonly
The top y-coordinate, offset from the baseline, of the receiver’s longest ascender.
-
- capHeight
readonly
The receiver’s cap height information.
-
- descender
readonly
The bottom y-coordinate, offset from the baseline, of the receiver’s longest descender.
-
- familyName
readonly
The font family name.
-
- fontName
readonly
The font face name.
-
- lineHeight
readonly
The height of text lines (measured in points).
-
- pointSize
readonly
The receiver’s point size, or the effective vertical point size for a font with a nonstandard matrix.
-
- xHeight
readonly
The x-height of the receiver.
Class Method Summary (collapse)
-
+ boldSystemFontOfSize:
Returns the font object used for standard interface items that are rendered in boldface type in the specified size.
-
+ buttonFontSize
Returns the standard font size used for buttons.
-
+ familyNames
Returns an array of font family names available on the system.
-
+ fontNamesForFamilyName:
Returns an array of font names available in a particular font family.
-
+ fontWithName:size:
Creates and returns a font object for the specified font name and size.
-
+ italicSystemFontOfSize:
Returns the font object used for standard interface items that are rendered in italic type in the specified size.
-
+ labelFontSize
Returns the standard font size used for labels.
-
+ smallSystemFontSize
Returns the size of the standard small system font.
-
+ systemFontOfSize:
Returns the font object used for standard interface items in the specified size.
-
+ systemFontSize
Returns the size of the standard system font.
Instance Method Summary (collapse)
-
- fontWithSize:
Returns a font object that is the same as the receiver but which has the specified size instead.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (Float) ascender (readonly)
The top y-coordinate, offset from the baseline, of the receiver’s longest ascender. (read-only) The ascender value is measured in points.
- (Float) capHeight (readonly)
The receiver’s cap height information. (read-only) This value measures (in points) the height of a capital character.
- (Float) descender (readonly)
The bottom y-coordinate, offset from the baseline, of the receiver’s longest descender. (read-only) The descender value is measured in points. This value may be positive or negative. For example, if the longest descender extends 2 points below the baseline, this method returns -2.0 .
- (String) familyName (readonly)
The font family name. (read-only) A family name is a name such as Times New Roman that identifies one or more specific fonts. The value in this property is intended for an application’s internal usage only and should not be displayed.
- (String) fontName (readonly)
The font face name. (read-only) The font name is a name such as HelveticaBold that incorporates the family name and any specific style information for the font. The value in this property is intended for an application’s internal usage only and should not be displayed.
- (Float) lineHeight (readonly)
The height of text lines (measured in points). (read-only)
- (Float) pointSize (readonly)
The receiver’s point size, or the effective vertical point size for a font with a nonstandard matrix. (read-only)
- (Float) xHeight (readonly)
The x-height of the receiver. (read-only) This value measures (in points) the height of the lowercase character "x".
Class Method Details
+ (UIFont) boldSystemFontOfSize(fontSize)
Returns the font object used for standard interface items that are rendered in boldface type in the specified size.
+ (Float) buttonFontSize
Returns the standard font size used for buttons.
+ (Array) familyNames
Returns an array of font family names available on the system. Font family names correspond to the base name of a font, such as Times New Roman. You can pass the returned strings to the fontNamesForFamilyName: method to retrieve a list of font names available for that family. You can then use the corresponding font name to retrieve an actual font object.
+ (Array) fontNamesForFamilyName(familyName)
Returns an array of font names available in a particular font family. You can pass the returned strings as parameters to the fontWithName:size: method to retrieve an actual font object.
+ (UIFont) fontWithName(fontName, size:fontSize)
Creates and returns a font object for the specified font name and size. You can use the fontNamesForFamilyName: method to retrieve the specific font names for a given font family.
+ (UIFont) italicSystemFontOfSize(fontSize)
Returns the font object used for standard interface items that are rendered in italic type in the specified size.
+ (Float) labelFontSize
Returns the standard font size used for labels.
+ (Float) smallSystemFontSize
Returns the size of the standard small system font.
+ (UIFont) systemFontOfSize(fontSize)
Returns the font object used for standard interface items in the specified size.
+ (Float) systemFontSize
Returns the size of the standard system font.
Instance Method Details
- (UIFont) fontWithSize(fontSize)
Returns a font object that is the same as the receiver but which has the specified size instead.