Flutter Engine
minikin::FontLanguage Struct Reference

#include <FontLanguage.h>

Public Types

enum  EmojiStyle : uint8_t {
  EMSTYLE_EMPTY = 0,
  EMSTYLE_DEFAULT = 1,
  EMSTYLE_EMOJI = 2,
  EMSTYLE_TEXT = 3
}
 

Public Member Functions

 FontLanguage ()
 
 FontLanguage (const char *buf, size_t length)
 
bool operator== (const FontLanguage other) const
 
bool operator!= (const FontLanguage other) const
 
bool isUnsupported () const
 
EmojiStyle getEmojiStyle () const
 
hb_language_t getHbLanguage () const
 
bool isEqualScript (const FontLanguage &other) const
 
bool supportsHbScript (hb_script_t script) const
 
std::string getString () const
 
int calcScoreFor (const FontLanguages &supported) const
 
uint64_t getIdentifier () const
 

Friends

class FontLanguages
 

Detailed Description

Definition at line 39 of file FontLanguage.h.

Member Enumeration Documentation

◆ EmojiStyle

Enumerator
EMSTYLE_EMPTY 
EMSTYLE_DEFAULT 
EMSTYLE_EMOJI 
EMSTYLE_TEXT 

Definition at line 41 of file FontLanguage.h.

Constructor & Destructor Documentation

◆ FontLanguage() [1/2]

minikin::FontLanguage::FontLanguage ( )
inline

Definition at line 48 of file FontLanguage.h.

References length.

49  : mScript(0ul),
50  mLanguage(INVALID_CODE),
51  mRegion(INVALID_CODE),
52  mHbLanguage(HB_LANGUAGE_INVALID),
53  mSubScriptBits(0ul),
54  mEmojiStyle(EMSTYLE_EMPTY) {}
const uint16_t INVALID_CODE
Definition: FontLanguage.h:32

◆ FontLanguage() [2/2]

minikin::FontLanguage::FontLanguage ( const char *  buf,
size_t  length 
)

Member Function Documentation

◆ calcScoreFor()

int minikin::FontLanguage::calcScoreFor ( const FontLanguages supported) const

Referenced by getHbLanguage().

◆ getEmojiStyle()

EmojiStyle minikin::FontLanguage::getEmojiStyle ( ) const
inline

Definition at line 68 of file FontLanguage.h.

68 { return mEmojiStyle; }

◆ getHbLanguage()

hb_language_t minikin::FontLanguage::getHbLanguage ( ) const
inline

Definition at line 69 of file FontLanguage.h.

References calcScoreFor(), getString(), isEqualScript(), and supportsHbScript().

69 { return mHbLanguage; }

◆ getIdentifier()

uint64_t minikin::FontLanguage::getIdentifier ( ) const
inline

Definition at line 85 of file FontLanguage.h.

85  {
86  return ((uint64_t)mLanguage << 49) | ((uint64_t)mScript << 17) |
87  ((uint64_t)mRegion << 2) | mEmojiStyle;
88  }

◆ getString()

std::string minikin::FontLanguage::getString ( ) const

Referenced by getHbLanguage().

◆ isEqualScript()

bool minikin::FontLanguage::isEqualScript ( const FontLanguage other) const

Referenced by getHbLanguage(), and operator==().

◆ isUnsupported()

bool minikin::FontLanguage::isUnsupported ( ) const
inline

Definition at line 67 of file FontLanguage.h.

References minikin::INVALID_CODE.

Referenced by operator==().

67 { return mLanguage == INVALID_CODE; }
const uint16_t INVALID_CODE
Definition: FontLanguage.h:32

◆ operator!=()

bool minikin::FontLanguage::operator!= ( const FontLanguage  other) const
inline

Definition at line 65 of file FontLanguage.h.

65 { return !(*this == other); }

◆ operator==()

bool minikin::FontLanguage::operator== ( const FontLanguage  other) const
inline

Definition at line 59 of file FontLanguage.h.

References isEqualScript(), and isUnsupported().

59  {
60  return !isUnsupported() && isEqualScript(other) &&
61  mLanguage == other.mLanguage && mRegion == other.mRegion &&
62  mEmojiStyle == other.mEmojiStyle;
63  }
bool isUnsupported() const
Definition: FontLanguage.h:67
bool isEqualScript(const FontLanguage &other) const

◆ supportsHbScript()

bool minikin::FontLanguage::supportsHbScript ( hb_script_t  script) const

Referenced by getHbLanguage().

Friends And Related Function Documentation

◆ FontLanguages

friend class FontLanguages
friend

Definition at line 91 of file FontLanguage.h.

Referenced by minikin::FontLanguages::FontLanguages().


The documentation for this struct was generated from the following file: