Free Electron
FontMaya.h
Go to the documentation of this file.
1 
2 /* Copyright (C) 2003-2021 Free Electron Organization
3  Any use of this software requires a license. If a valid license
4  was not distributed with this file, visit freeelectron.org. */
5 
6 /** @file */
7 
8 #ifndef __maya_FontMaya_h__
9 #define __maya_FontMaya_h__
10 
11 namespace fe
12 {
13 namespace ext
14 {
15 
16 /**************************************************************************//**
17  @brief Maya-specific implementations for FontI
18 
19  @ingroup maya
20 *//***************************************************************************/
21 class FE_DL_EXPORT FontMaya: public FontI,
22  public CastableAs<FontMaya>
23 {
24  public:
25  FontMaya(void);
26 virtual ~FontMaya(void);
27 
28 virtual I32 fontHeight(I32* a_pAscent,I32* a_pDescent)
29  {
30  if(a_pAscent)
31  {
32  *a_pAscent=m_fontAscent;
33  }
34  if(a_pDescent)
35  {
36  *a_pDescent=m_fontDescent;
37  }
38 
39  return m_fontAscent+m_fontDescent;
40  }
41 virtual I32 pixelWidth(String a_string)
42  { return m_charWidth*a_string.length(); }
43 
44 virtual void drawAlignedText(sp<Component> a_spDrawComponent,
45  const SpatialVector& a_location,
46  const String a_text,const Color &a_color);
47 
48  private:
49 
50  I32 m_fontAscent;
51  I32 m_fontDescent;
52  I32 m_charWidth;
53 };
54 
55 } /* namespace ext */
56 } /* namespace fe */
57 
58 #endif /* __maya_FontMaya_h__ */
kernel
Definition: namespace.dox:3
General interface to a window.
Definition: FontI.h:20
Special vector for color (RGBA)
Definition: Color.h:21
Automatically reference-counted string container.
Definition: String.h:128
Maya-specific implementations for FontI.
Definition: FontMaya.h:21
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
U32 length(void) const
Return the number of represented characters, but not necessarily the size of any buffer.
Definition: String.h:662
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192