Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Friends | List of all members
ON_FontList Class Reference

#include <opennurbs_font.h>

Public Member Functions

 ON_FontList ()
 
 ON_FontList (bool bMatchUnderlineStrikethroughAndPointSize)
 
 ~ON_FontList ()
 
unsigned int AddFont (const ON_Font *font, bool bCheckForDuplicates)
 
unsigned int AddFonts (const ON_SimpleArray< const ON_Font * > &fonts)
 
unsigned int AddFonts (size_t font_count, const ON_Font *const *font_list)
 
const ON_SimpleArray< const class ON_Font * > & ByFamilyName () const
 
const ON_SimpleArray< const class ON_Font * > & ByFontCharacteristicsHash () const
 
const ON_SimpleArray< const class ON_Font * > & ByIndex () const
 
const ON_SimpleArray< const class ON_Font * > & ByPostScriptName () const
 
const ON_SimpleArray< const class ON_Font * > & ByQuartetName () const
 
const ON_SimpleArray< const class ON_Font * > & ByWindowsLogfontName () const
 
unsigned int Count () const
 
const ON_FontFamilyMemberWithWeightStretchStyle (const ON_Font *font, ON_Font::Weight desired_weight, ON_Font::Stretch desired_stretch, ON_Font::Style desired_style) const
 
const ON_FontFamilyMemberWithWeightStretchStyle (const wchar_t *family_name, ON_Font::Weight desired_weight, ON_Font::Stretch desired_stretch, ON_Font::Style desired_style) const
 
const ON_FontFontFromQuartetProperties (const wchar_t *quartet_name, bool bBold, bool bItalic) const
 
unsigned int FontListFromNames (const wchar_t *postscript_name, const wchar_t *windows_logfont_name, const wchar_t *family_name, const wchar_t *face_name, ON_SimpleArray< const ON_Font * > &font_list) const
 
const ON_FontFromFamilyName (const wchar_t *family_name, const wchar_t *prefered_face_name) const
 
const ON_FontFromFamilyName (const wchar_t *family_name, const wchar_t *prefered_face_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style) const
 
const ON_FontFromFamilyName (const wchar_t *family_name, const wchar_t *prefered_face_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style, bool bUnderlined, bool bStrikethrough) const
 
const ON_FontFromFontCharacteristicsHash (ON_SHA1_Hash font_characteristics_hash, bool bReturnFirst) const
 
const ON_FontFromFontProperties (const ON_Font *font_properties, bool bRequireFaceMatch, bool bRequireStyleMatch) const
 
const ON_FontFromFontProperties (const ON_Font *font_properties, bool bRequireFaceMatch, bool bRequireStyleMatch, bool bUnderlined, bool bStrikethrough, double point_size) const
 
const ON_FontFromNames (const wchar_t *postscript_name, const wchar_t *windows_logfont_name, const wchar_t *family_name, const wchar_t *prefered_face_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style, bool bRequireFaceMatch, bool bRequireStyleMatch) const
 
const ON_FontFromNames (const wchar_t *postscript_name, const wchar_t *windows_logfont_name, const wchar_t *family_name, const wchar_t *prefered_face_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style, bool bRequireFaceMatch, bool bRequireStyleMatch, bool bUnderlined, bool bStrikethrough, double point_size) const
 
const ON_FontFromPostScriptName (const wchar_t *postscript_name) const
 
const ON_FontFromPostScriptName (const wchar_t *postscript_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style) const
 
const ON_FontFromPostScriptName (const wchar_t *postscript_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style, bool bUnderlined, bool bStrikethrough) const
 
const ON_FontFromRichTextProperties (const wchar_t *rtf_font_name, bool bRtfBold, bool bRtfItalic, bool bUnderlined, bool bStrikethrough) const
 
const ON_FontFromWindowsLogfontName (const wchar_t *windows_logfont_name) const
 
const ON_FontFromWindowsLogfontName (const wchar_t *windows_logfont_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style) const
 
const ON_FontFromWindowsLogfontName (const wchar_t *windows_logfont_name, ON_Font::Weight prefered_weight, ON_Font::Stretch prefered_stretch, ON_Font::Style prefered_style, bool bUnderlined, bool bStrikethrough) const
 
ON_Font::NameLocale NameLocale () const
 
const ON_FontFaceQuartet QuartetFromQuartetName (const wchar_t *quartet_name) const
 
const ON_ClassArray< ON_FontFaceQuartet > & QuartetList () const
 

Static Public Member Functions

static int CompareEnglishFamilyAndFaceName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareEnglishFamilyName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareEnglishPostScriptName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareEnglishWindowsLogfontName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareFamilyAndFaceName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareFamilyAndWindowsLogfontName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareFamilyName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareFontCharacteristicsHash (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int ComparePostScriptName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareQuartetName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareStretch (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareUnderlinedStrikethroughPointSize (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareWeightStretchStyle (ON_Font const *const *lhs, ON_Font const *const *rhs)
 
static int CompareWindowsLogfontName (ON_Font const *const *lhs, ON_Font const *const *rhs)
 

Friends

class ON_ManagedFonts
 

Constructor & Destructor Documentation

◆ ON_FontList() [1/2]

ON_FontList::ON_FontList ( )

◆ ON_FontList() [2/2]

ON_FontList::ON_FontList ( bool  bMatchUnderlineStrikethroughAndPointSize)

Parameters: bMatchUnderlineStrikethroughAndPointSize - [in] False to ignore underline, strikethrough, and point size properties (installed font list) True to match underline, strikethrough and point size properties (managed font list)

◆ ~ON_FontList()

ON_FontList::~ON_FontList ( )

Member Function Documentation

◆ AddFont()

unsigned int ON_FontList::AddFont ( const ON_Font font,
bool  bCheckForDuplicates 
)

◆ AddFonts() [1/2]

unsigned int ON_FontList::AddFonts ( const ON_SimpleArray< const ON_Font * > &  fonts)

◆ AddFonts() [2/2]

unsigned int ON_FontList::AddFonts ( size_t  font_count,
const ON_Font *const *  font_list 
)

◆ ByFamilyName()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByFamilyName ( ) const

Returns: Array of fonts sorted by ON_Font.FamilyName() and then by ON_Font.FaceName().

◆ ByFontCharacteristicsHash()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByFontCharacteristicsHash ( ) const

Returns: Array of fonts sorted by ON_Font.yFontCharacteristicsHash().

◆ ByIndex()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByIndex ( ) const

Returns: Array of fonts in the order they were added.

◆ ByPostScriptName()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByPostScriptName ( ) const

Returns: Array of fonts sorted by ON_Font.PostScriptName().

◆ ByQuartetName()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByQuartetName ( ) const

Returns: Array of fonts sorted by ON_Font.QuartetName().

◆ ByWindowsLogfontName()

const ON_SimpleArray< const class ON_Font* >& ON_FontList::ByWindowsLogfontName ( ) const

Returns: Array of fonts sorted by ON_Font.WindowsLogfontName().

◆ CompareEnglishFamilyAndFaceName()

static int ON_FontList::CompareEnglishFamilyAndFaceName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareEnglishFamilyName()

static int ON_FontList::CompareEnglishFamilyName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareEnglishPostScriptName()

static int ON_FontList::CompareEnglishPostScriptName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareEnglishWindowsLogfontName()

static int ON_FontList::CompareEnglishWindowsLogfontName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareFamilyAndFaceName()

static int ON_FontList::CompareFamilyAndFaceName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareFamilyAndWindowsLogfontName()

static int ON_FontList::CompareFamilyAndWindowsLogfontName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareFamilyName()

static int ON_FontList::CompareFamilyName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareFontCharacteristicsHash()

static int ON_FontList::CompareFontCharacteristicsHash ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ ComparePostScriptName()

static int ON_FontList::ComparePostScriptName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareQuartetName()

static int ON_FontList::CompareQuartetName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareStretch()

static int ON_FontList::CompareStretch ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareUnderlinedStrikethroughPointSize()

static int ON_FontList::CompareUnderlinedStrikethroughPointSize ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareWeightStretchStyle()

static int ON_FontList::CompareWeightStretchStyle ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ CompareWindowsLogfontName()

static int ON_FontList::CompareWindowsLogfontName ( ON_Font const *const *  lhs,
ON_Font const *const *  rhs 
)
static

◆ Count()

unsigned int ON_FontList::Count ( ) const

Returns: Number of fonts in the list.

◆ FamilyMemberWithWeightStretchStyle() [1/2]

const ON_Font* ON_FontList::FamilyMemberWithWeightStretchStyle ( const ON_Font font,
ON_Font::Weight  desired_weight,
ON_Font::Stretch  desired_stretch,
ON_Font::Style  desired_style 
) const

Parameters: font - [in] Used to identify the family, desired_weight - [in] new weight or unset if font weight is adequate desired_stretch - [in] new stretch or unset if font stretch is adequate desired_style - [in] new style or unset if font style is adequate Returns: A font in the same family with that comes a close as possible to matching the desired weight, stretch and style.

◆ FamilyMemberWithWeightStretchStyle() [2/2]

const ON_Font* ON_FontList::FamilyMemberWithWeightStretchStyle ( const wchar_t *  family_name,
ON_Font::Weight  desired_weight,
ON_Font::Stretch  desired_stretch,
ON_Font::Style  desired_style 
) const

Parameters: family name - [in] desired_weight - [in] desired_stretch - [in] desired_style - [in] Returns: A font in the same family with that comes a close as possible to matching the desired weight, stretch and style.

◆ FontFromQuartetProperties()

const ON_Font* ON_FontList::FontFromQuartetProperties ( const wchar_t *  quartet_name,
bool  bBold,
bool  bItalic 
) const

Description: Find a font in this list with the specified quartet properties. Parameters: quartet_name - [in] bBold - [in] bItalic - [in] Returns: font in the list with specified quartet properties or nullptr if none exists.

◆ FontListFromNames()

unsigned int ON_FontList::FontListFromNames ( const wchar_t *  postscript_name,
const wchar_t *  windows_logfont_name,
const wchar_t *  family_name,
const wchar_t *  face_name,
ON_SimpleArray< const ON_Font * > &  font_list 
) const

Description: Get the subset of fonts in this list with matching names.

◆ FromFamilyName() [1/3]

const ON_Font* ON_FontList::FromFamilyName ( const wchar_t *  family_name,
const wchar_t *  prefered_face_name 
) const

◆ FromFamilyName() [2/3]

const ON_Font* ON_FontList::FromFamilyName ( const wchar_t *  family_name,
const wchar_t *  prefered_face_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style 
) const

◆ FromFamilyName() [3/3]

const ON_Font* ON_FontList::FromFamilyName ( const wchar_t *  family_name,
const wchar_t *  prefered_face_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style,
bool  bUnderlined,
bool  bStrikethrough 
) const

◆ FromFontCharacteristicsHash()

const ON_Font* ON_FontList::FromFontCharacteristicsHash ( ON_SHA1_Hash  font_characteristics_hash,
bool  bReturnFirst 
) const

Parameters: font_characteristics_hash - [in] bReturnFirst - [in] If there are multiple fonts with the same hash and bReturnFirst is true, then the first font with tht hash is returned. If there are multiple fonts with the same hash and bReturnFirst is false, then nullptr is returned. new style or unset if font style is adequate Returns: A font with the specified font characteristics hash.

◆ FromFontProperties() [1/2]

const ON_Font* ON_FontList::FromFontProperties ( const ON_Font font_properties,
bool  bRequireFaceMatch,
bool  bRequireStyleMatch 
) const

◆ FromFontProperties() [2/2]

const ON_Font* ON_FontList::FromFontProperties ( const ON_Font font_properties,
bool  bRequireFaceMatch,
bool  bRequireStyleMatch,
bool  bUnderlined,
bool  bStrikethrough,
double  point_size 
) const

◆ FromNames() [1/2]

const ON_Font* ON_FontList::FromNames ( const wchar_t *  postscript_name,
const wchar_t *  windows_logfont_name,
const wchar_t *  family_name,
const wchar_t *  prefered_face_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style,
bool  bRequireFaceMatch,
bool  bRequireStyleMatch 
) const

Parameters: postscript_name - [in] windows_logfont_name - [in] family_name - [in] The returned font will have an exact match for one of the three names, postscript_name, windows_logfont_name, or family_name.

prefered_face_name - [in] prefered_weight - [in]
prefered_stretch - [in] prefered_style - [in] Preferred font properties.

bRequireFaceMatch - [in] If true and face_name is not empty, then the returned font will have an exact match for either postscript_name, windows_logfont_name, or the family and face name pair.

bRequireStyleMatch - [in] If true and prefered_stretch is not unset, then the returned font will have prefered_style Remarks: Ignores underlined, strikethrough, and point size settings when looking for a match.

◆ FromNames() [2/2]

const ON_Font* ON_FontList::FromNames ( const wchar_t *  postscript_name,
const wchar_t *  windows_logfont_name,
const wchar_t *  family_name,
const wchar_t *  prefered_face_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style,
bool  bRequireFaceMatch,
bool  bRequireStyleMatch,
bool  bUnderlined,
bool  bStrikethrough,
double  point_size 
) const

Parameters: postscript_name - [in] windows_logfont_name - [in] family_name - [in] The returned font will have an exact match for one of the three names, postscript_name, windows_logfont_name, or family_name.

prefered_face_name - [in] prefered_weight - [in]
prefered_stretch - [in] prefered_style - [in] Preferred font properties.

bRequireFaceMatch - [in] If true and face_name is not empty, then the returned font will have an exact match for either postscript_name, windows_logfont_name, or the family and face name pair.

bRequireStyleMatch - [in] If true and prefered_stretch is not unset, then the returned font will have prefered_style

bUnderlined - [in] Exact match required. bStrikethrough - [in] Exact match required. point_size - [in] Exact match required.

◆ FromPostScriptName() [1/3]

const ON_Font* ON_FontList::FromPostScriptName ( const wchar_t *  postscript_name) const

◆ FromPostScriptName() [2/3]

const ON_Font* ON_FontList::FromPostScriptName ( const wchar_t *  postscript_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style 
) const

◆ FromPostScriptName() [3/3]

const ON_Font* ON_FontList::FromPostScriptName ( const wchar_t *  postscript_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style,
bool  bUnderlined,
bool  bStrikethrough 
) const

◆ FromRichTextProperties()

const ON_Font* ON_FontList::FromRichTextProperties ( const wchar_t *  rtf_font_name,
bool  bRtfBold,
bool  bRtfItalic,
bool  bUnderlined,
bool  bStrikethrough 
) const

Parameters: rtf_font_name - [in] Rich text format name. This name is not well defined and depends on the device and application that created the rich text. On Windows this is often a LOGFONT.lfFaceName. On MacOS it is often a PostScript name.

bRtfBold - [in] RTF bold flag

bRtfItalic - [in] RTF italic flag

Deprecated:
Use the static ON_Font::FontFromRichTextProperties()

◆ FromWindowsLogfontName() [1/3]

const ON_Font* ON_FontList::FromWindowsLogfontName ( const wchar_t *  windows_logfont_name) const

◆ FromWindowsLogfontName() [2/3]

const ON_Font* ON_FontList::FromWindowsLogfontName ( const wchar_t *  windows_logfont_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style 
) const

◆ FromWindowsLogfontName() [3/3]

const ON_Font* ON_FontList::FromWindowsLogfontName ( const wchar_t *  windows_logfont_name,
ON_Font::Weight  prefered_weight,
ON_Font::Stretch  prefered_stretch,
ON_Font::Style  prefered_style,
bool  bUnderlined,
bool  bStrikethrough 
) const

◆ NameLocale()

ON_Font::NameLocale ON_FontList::NameLocale ( ) const

◆ QuartetFromQuartetName()

const ON_FontFaceQuartet ON_FontList::QuartetFromQuartetName ( const wchar_t *  quartet_name) const

Returns: The quartet with the specified name or ON_FontFaceQuartet::Empty if none exists.

◆ QuartetList()

const ON_ClassArray< ON_FontFaceQuartet >& ON_FontList::QuartetList ( ) const

Returns: Array of font face quartets for this list sorted quartet name. Remarks: This is pribarily for old-fashioned font selection UI that harkens back to the days of LOGFONT. The UI displays a name and a bold and italic button that lets you select one of four related faces. The name used to be based on the LOGFONT name. Depending on the contents of the list, there may be some faces in the list that do not appear in the QuartetList().

Friends And Related Function Documentation

◆ ON_ManagedFonts

friend class ON_ManagedFonts
friend