All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FontCharacterTable.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Fonts.h"
7 #include "FontCharacter.h"
8 #include "tr1.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Fonts
14  {
16  {
17  public:
18  FontCharacterTable(size_t reserveSize);
19 
20  void AddCharacter(u32 charUnicode, const FontCharacter& fontCharacter);
21 
22  const FontCharacter& GetCharacter(u32 charUnicode) const;
23  const FontCharacter& GetCharacterOrDefault(u32 charUnicode) const;
24  bool ContainsCharacter(u32 charUnicode) const;
25  void SetDefaultCharacter(const FontCharacter& defaultCharacter);
26  private:
27  std::vector<FontCharacter> m_characters;
28 
29  typedef Eegeo::unordered_map<u32, int>::type TUnicodeToIndex;
30  TUnicodeToIndex m_unicodeToIndex;
31 
32  FontCharacter m_defaultCharacter;
33  };
34  }
35 }