RAMSES Documentation  27.0.130
Information for RAMSES users and developers
FontCascade.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2018 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_FONTCASCADE_H
10 #define RAMSES_FONTCASCADE_H
11 
14 #include <string>
15 #include <vector>
16 
17 namespace ramses
18 {
19  class IFontAccessor;
20 
22  using OrderedFontList = std::vector<FontInstanceId>;
23 
31  struct FontCascade
32  {
35 
37  std::u32string charsToRemove;
38 
41 
44 
46  char32_t fallbackChar;
47 
60  static RAMSES_API std::u32string FilterAndFindFontInstancesForString(const FontCascade& fontCascade, const std::u32string& str, FontInstanceOffsets& fontOffsets);
61  };
62 
63 }
64 
65 #endif
#define RAMSES_API
Definition: APIExport.h:35
Interface for getting font instances using font instance ids.
Definition: IFontAccessor.h:27
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
std::vector< FontInstanceId > OrderedFontList
vector of FontInstanceId for use in FontCascade
Definition: FontCascade.h:22
std::vector< FontInstanceOffset > FontInstanceOffsets
Vector of FontInstanceOffset elements.
Definition: FontInstanceOffsets.h:34
struct to define a font cascade
Definition: FontCascade.h:32
OrderedFontList fontPriorityList
Ordered list of font instance ids to try for each character.
Definition: FontCascade.h:40
const IFontAccessor & fontAccessor
interface to use to resolve FontInstanceId to a FontInstance
Definition: FontCascade.h:34
char32_t fallbackChar
Fallback character when no match was found in fontPriorityList.
Definition: FontCascade.h:46
std::u32string charsToRemove
String of characters that will be removed from a processed string.
Definition: FontCascade.h:37
FontInstanceId fallbackFont
Fallback font used for fallbackChar when none in fontPriorityList matched.
Definition: FontCascade.h:43
static RAMSES_API std::u32string FilterAndFindFontInstancesForString(const FontCascade &fontCascade, const std::u32string &str, FontInstanceOffsets &fontOffsets)
Process a character string according to given FontCascade.