Free Electron
FontFreeTypeGL.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 __opengl_FontFreeTypeGL_h__
9 #define __opengl_FontFreeTypeGL_h__
10 
11 namespace fe
12 {
13 namespace ext
14 {
15 
16 /**************************************************************************//**
17  @brief OpenGL-specific implementations for FontI
18 
19  @ingroup opengl
20 *//***************************************************************************/
21 class FE_DL_EXPORT FontFreeTypeGL: public FontI,
22  public Initialize<FontFreeTypeGL>
23 {
24  public:
25  FontFreeTypeGL(void);
26 virtual ~FontFreeTypeGL(void);
27 
28  void initialize(void);
29 
30 virtual I32 fontHeight(I32* a_pAscent,I32* a_pDescent)
31  {
32  if(a_pAscent)
33  {
34  *a_pAscent=m_fontAscent;
35  }
36  if(a_pDescent)
37  {
38  *a_pDescent=m_fontDescent;
39  }
40 
41  return m_fontAscent+m_fontDescent;
42  }
43 virtual I32 pixelWidth(String a_string);
44 
45 virtual void drawAlignedText(sp<Component> a_spDrawComponent,
46  const SpatialVector& a_location,
47  const String a_text,const Color &a_color);
48 
49  private:
50  void add_text(const SpatialVector& a_location,
51  const String a_text,const Color &a_color);
52 
53  String m_freetypePath;
54  String m_fontName;
55  Real m_fontSize;
56  BWORD m_fixedWidth;
57  I32 m_maxWidth;
58 
59  I32 m_fontAscent;
60  I32 m_fontDescent;
61 
62  Real m_multiplication;
63 
64  texture_atlas_t* m_pAtlas;
65  texture_font_t* m_pFont;
66  vertex_buffer_t* m_pBuffer;
67  GLuint m_shader;
68 };
69 
70 } /* namespace ext */
71 } /* namespace fe */
72 
73 #endif /* __opengl_FontFreeTypeGL_h__ */
kernel
Definition: namespace.dox:3
General interface to a window.
Definition: FontI.h:20
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Special vector for color (RGBA)
Definition: Color.h:21
OpenGL-specific implementations for FontI.
Definition: FontFreeTypeGL.h:21
Automatically reference-counted string container.
Definition: String.h:128
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53