Loading...
Searching...
No Matches
Classes | Enumerations | Functions
Font.h File Reference

BFont class definition, unicode_block class definition, and font-related struct and enum definitions. More...

Classes

class  BFont
 Represents a typeface including its family, style and size. More...
 
struct  edge_info
 The distance that a character outline is inset from its escapement boundaries. More...
 
struct  escapement_delta
 A struct that allows you to specify extra horizontal space to surround each character with. More...
 
struct  font_cache_info
 Font cache parameters. More...
 
struct  font_height
 The amount of vertical space surrounding a character. More...
 
struct  tuned_font_info
 Tuning information of fonts used to make it look better when displayed on-screen. More...
 
class  unicode_block
 Describes the blocks of Unicode characters supported by a font. More...
 

Enumerations

enum  {
  B_CHAR_SPACING = 0 ,
  B_STRING_SPACING = 1 ,
  B_BITMAP_SPACING = 2 ,
  B_FIXED_SPACING = 3
}
 
enum  {
  B_DISABLE_ANTIALIASING = 0x00000001 ,
  B_FORCE_ANTIALIASING = 0x00000002
}
 
enum  {
}
 
enum  {
  B_UNICODE_UTF8 = 0 ,
  B_ISO_8859_1 = 1 ,
  B_ISO_8859_2 = 2 ,
  B_ISO_8859_3 = 3 ,
  B_ISO_8859_4 = 4 ,
  B_ISO_8859_5 = 5 ,
  B_ISO_8859_6 = 6 ,
  B_ISO_8859_7 = 7 ,
  B_ISO_8859_8 = 8 ,
  B_ISO_8859_9 = 9 ,
  B_ISO_8859_10 = 10 ,
  B_MACINTOSH_ROMAN = 11
}
 
enum  {
  B_HAS_TUNED_FONT = 0x0001 ,
  B_IS_FIXED = 0x0002
}
 
enum  {
  B_ITALIC_FACE = 0x0001 ,
  B_UNDERSCORE_FACE = 0x0002 ,
  B_NEGATIVE_FACE = 0x0004 ,
  B_OUTLINED_FACE = 0x0008 ,
  B_STRIKEOUT_FACE = 0x0010 ,
  B_BOLD_FACE = 0x0020 ,
  B_REGULAR_FACE = 0x0040 ,
  B_CONDENSED_FACE = 0x0080 ,
  B_LIGHT_FACE = 0x0100 ,
  B_HEAVY_FACE = 0x0200
}
 
enum  font_direction {
  B_FONT_LEFT_TO_RIGHT = 0 ,
  B_FONT_RIGHT_TO_LEFT = 1
}
 
enum  font_file_format {
  B_TRUETYPE_WINDOWS = 0 ,
  B_POSTSCRIPT_TYPE1_WINDOWS = 1
}
 
enum  font_metric_mode {
  B_SCREEN_METRIC = 0 ,
  B_PRINTING_METRIC = 1
}
 

Functions

int32 count_font_families (void)
 Gets the number of installed font families.
 
int32 count_font_styles (font_family name)
 Gets the number of styles available for a font family.
 
status_t get_font_family (int32 index, font_family *name, uint32 *flags=NULL)
 Retrieves the family name at the specified index.
 
status_t get_font_style (font_family family, int32 index, font_style *name, uint16 *face, uint32 *flags=NULL)
 Retrieves the family name at the specified index.
 
status_t get_font_style (font_family family, int32 index, font_style *name, uint32 *flags=NULL)
 Retrieves the family name at the specified index.
 
bool update_font_families (bool checkOnly)
 Updates the font families list.
 

Detailed Description

BFont class definition, unicode_block class definition, and font-related struct and enum definitions.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
B_CHAR_SPACING 

Position each character without adjustment. Best mode for printing.

Since
BeOS R3
B_STRING_SPACING 

Optimizes the position of each character within its space. Collisions are unlikely but characters may touch each other. Best mode to use when the screen needs to match what appears on the printed page.

Since
BeOS R3
B_BITMAP_SPACING 

The widths of the characters are chosen so that they never collide and rarely touch. Best mode for drawing small amounts of text.

Since
BeOS R3
B_FIXED_SPACING 

Positions characters at a constant width. Best mode for fixed-width fonts.

Since
BeOS R3

◆ anonymous enum

anonymous enum
Enumerator
B_DISABLE_ANTIALIASING 

Disable antialiasing. Used by BFont::Flags() and BFont::SetFlags().

Since
BeOS R3
B_FORCE_ANTIALIASING 

Force antialiasing. Used by BFont::Flags() and BFont::SetFlags().

Since
BeOS R3

◆ anonymous enum

anonymous enum
Enumerator
B_TRUNCATE_END 

Truncate from the end of the string.

Since
BeOS R3
B_TRUNCATE_BEGINNING 

Truncate from the beginning of the string.

Since
BeOS R3
B_TRUNCATE_MIDDLE 

Truncate from the middle of the string.

Since
BeOS R3
B_TRUNCATE_SMART 

Truncate while keeping each string unique.

Since
BeOS R3

◆ anonymous enum

anonymous enum
Enumerator
B_UNICODE_UTF8 

UTF-8 font encoding.

Since
BeOS R3
B_ISO_8859_1 

ISO 8859-1 aka Latin 1 "Western European" font encoding.

Since
BeOS R3
B_ISO_8859_2 

ISO 8859-2 aka Latin 2 "Eastern European" font encoding.

Since
BeOS R3
B_ISO_8859_3 

ISO 8859-3 aka Latin 3 "South European" font encoding.

Since
BeOS R3
B_ISO_8859_4 

ISO 8859-4 aka Latin 4 "Northern European" font encoding.

Since
BeOS R3
B_ISO_8859_5 

ISO 8859-5 "Latin/Cyrillic" font encoding.

Since
BeOS R3
B_ISO_8859_6 

ISO 8859-6 "Latin/Arabic" font encoding.

Since
BeOS R3
B_ISO_8859_7 

ISO 8859-7 "Latin/Greek" font encoding.

Since
BeOS R3
B_ISO_8859_8 

ISO 8859-8 "Latin/Hebrew" font encoding.

Since
BeOS R3
B_ISO_8859_9 

ISO 8859-9 aka Latin 5 "Latin/Turkish" font encoding.

Since
BeOS R3
B_ISO_8859_10 

ISO 8859-10 aka Latin 6 "Nordic" font encoding.

Since
BeOS R3
B_MACINTOSH_ROMAN 

Macintosh Roman font encoding.

Since
BeOS R3

◆ anonymous enum

anonymous enum
Enumerator
B_HAS_TUNED_FONT 

Indicates that the font has been adjusted to look good on the screen.

Since
BeOS R4
B_IS_FIXED 

Indicates that the font is non-proportional.

Since
BeOS R4

◆ anonymous enum

anonymous enum
Enumerator
B_ITALIC_FACE 

Italic font face flag.

Since
BeOS R4
B_UNDERSCORE_FACE 

Underscore font face flag.

Since
BeOS R4
B_NEGATIVE_FACE 

Negative font face flag.

Since
BeOS R4
B_OUTLINED_FACE 

Outline font face flag.

Since
BeOS R4
B_STRIKEOUT_FACE 

Strikeout font face flag.

Since
BeOS R4
B_BOLD_FACE 

Bold font face flag.

Since
BeOS R4
B_REGULAR_FACE 

Regular font face flag.

Since
BeOS R4
B_CONDENSED_FACE 

Condensed font face flag.

Since
Haiku R1
B_LIGHT_FACE 

Light font face flag.

Since
Haiku R1
B_HEAVY_FACE 

Heavy font face flag.

Since
Haiku R1

◆ font_direction

Enumerator
B_FONT_LEFT_TO_RIGHT 

Left to right.

Since
BeOS R3
B_FONT_RIGHT_TO_LEFT 

Right to left.

Since
BeOS R3

◆ font_file_format

Enumerator
B_TRUETYPE_WINDOWS 

TrueType™ font file format.

Since
BeOS R4
B_POSTSCRIPT_TYPE1_WINDOWS 

PostScript™ Type1 font file format.

Since
BeOS R4

◆ font_metric_mode

Enumerator
B_SCREEN_METRIC 

Screen font metric mode.

Since
BeOS R4
B_PRINTING_METRIC 

Printing font metric mode.

Since
BeOS R4

Function Documentation

◆ count_font_families()

int32 count_font_families ( void  )

Gets the number of installed font families.

Returns
The number of installed font families
Since
BeOS R3

◆ count_font_styles()

int32 count_font_styles ( font_family  family)

Gets the number of styles available for a font family.

Returns
The number of styles available for a font family.
Since
BeOS R3

◆ get_font_family()

status_t get_font_family ( int32  index,
font_family *  _name,
uint32 _flags = NULL 
)

Retrieves the family name at the specified index.

Parameters
indexUnique font identifier code.
_namefont_family String to receive the name of the family.
_flagsif non-NULL, the values of the flags IS_FIXED and B_HAS_TUNED_FONT are returned.
Returns
A status code, B_OK on success or an error code.
Return values
B_BAD_VALUE_name is NULL.
B_ERRORindex does not correspond to a font family.
Since
BeOS R3

◆ get_font_style() [1/2]

status_t get_font_style ( font_family  family,
int32  index,
font_style *  _name,
uint16 _face,
uint32 _flags = NULL 
)

Retrieves the family name at the specified index.

The face value returned by this function is not very reliable. At the same time, the value returned should be fairly reliable, returning the proper flag for 90%-99% of font names.

Parameters
familyThe font family.
indexUnique font identifier code.
_nameString to receive the name of the family.
_facerecipient of font face value, such as B_REGULAR_FACE.
_flagsif non-NULL, the values of the flags IS_FIXED and B_HAS_TUNED_FONT are returned.
Returns
A status code, B_OK on success or an error code.
Return values
B_ERRORindex does not correspond to a font style.
Since
BeOS R3

◆ get_font_style() [2/2]

status_t get_font_style ( font_family  family,
int32  index,
font_style *  _name,
uint32 _flags = NULL 
)

Retrieves the family name at the specified index.

Parameters
familyThe font family.
indexUnique font identifier code.
_namestring to receive the name of the family.
_flagsif non-NULL, the values of the flags IS_FIXED and B_HAS_TUNED_FONT are returned
Returns
A status code, B_OK on success or an error code.
Return values
B_ERRORindex does not correspond to a font style.
Since
BeOS R3

◆ update_font_families()

bool update_font_families ( bool  checkOnly)

Updates the font families list.

Parameters
checkOnlyParameter is ignored.
Returns
true if the font list has changed, false if not.
Since
BeOS R3