CFx SDK Documentation  2022 SP0
TrVecTtfFontsCache.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 // GLES2 device TTF fonts cache support
24 
25 #ifndef ODTRVECTTFFONTSCACHE
26 #define ODTRVECTTFFONTSCACHE
27 
28 #include "TD_PackPush.h"
29 
30 #include "TrVecDefs.h"
31 #include "../TrVisTtfFontsCacheClient.h"
32 #ifndef OD_TTFFONTSCACHE_SHAREABLENAMESPACE
33 #define OD_TTFFONTSCACHE_SHAREABLENAMESPACE OdTrVecShareableNS
34 #endif // OD_TTFFONTSCACHE_SHAREABLENAMESPACE
35 #include "TtfFontsCache.h"
36 #ifdef OD_TTFFONTSCACHE_SHAREABLENAMESPACE
38 #endif // OD_TTFFONTSCACHE_SHAREABLENAMESPACE
39 #include "ExDrawOrderBase.h"
40 
41 #include "StaticRxObject.h"
42 
43 class OdTrVecDevice;
44 
48 class OdTrVecTtfFontsCache : public OdStaticRxObject<OdTtfFontsCache>, public OdTrVisTtfFontsCacheClient
49 {
50  protected:
53  public:
56 
57  OdDrawOrderMetafileBase &deviceRefs() { return m_deviceRefs; }
58 
59  bool useStableFontKey() const { return m_bStableKey; }
60  void setUseStableFontKey(bool bStableKey) { m_bStableKey = bStableKey; }
61  void setUseStableFontKey(OdTrVecDevice *pDevice);
62 
63  const void *getFontCache(const FontKey &fontKey) const;
64  OdTrVisDisplayId getCharMetafile(const void *pFont, OdUInt32 uChar, double *pSideMult = NULL);
65 
66  void shareToNew(OdTrVecDevice *pDevice);
67 
68  OdRxObjectPtr tfcNewMetafile(void *pSessionId);
69  OdGiConveyorGeometry *tfcBeginMetafile(OdRxObject *pMetafile, void *pSessionId);
70  void tfcFinalizeMetafileExt(FontKey &fontKey, CharKey chr, OdRxObject *pMetafile, void *pSessionId);
71  void tfcFinalizeMetafile(OdRxObject *pMetafile, void *pSessionId);
72  void tfcPlayMetafile(const OdGeMatrix3d &xForm, const OdRxObject *pMetafile, void *pSessionId) const;
73  protected:
74  OdUInt64 getFontKey(const OdGiTextStyle *pTextStyle) const;
75  TtfFont getFontCache(OdUInt64 fontKeyPartA, OdUInt64 fontKeyPartB) const
76  { return (TtfFont)getFontCache(FontKey(fontKeyPartA, fontKeyPartB)); }
77  OdTrVisDisplayId getCharMetafile(TtfFont pFont, OdUInt32 uChar, double *pSideMult = NULL) const
78  { return const_cast<OdTrVecTtfFontsCache*>(this)->getCharMetafile((const void *)pFont, uChar, pSideMult); }
79 };
80 
81 #include "TD_PackPop.h"
82 
83 #endif // ODTRVECTTFFONTSCACHE
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
#define OD_TTFFONTSCACHE_SHAREABLENAMESPACE
OdUInt64 getFontKey(const OdGiTextStyle *pTextStyle) const
void shareToNew(OdTrVecDevice *pDevice)
OdGiConveyorGeometry * tfcBeginMetafile(OdRxObject *pMetafile, void *pSessionId)
const void * getFontCache(const FontKey &fontKey) const
OdTrVisDisplayId getCharMetafile(TtfFont pFont, OdUInt32 uChar, double *pSideMult=NULL) const
void tfcFinalizeMetafile(OdRxObject *pMetafile, void *pSessionId)
OdStaticRxObject< OdDrawOrderMetafileBase > m_deviceRefs
OdTrVisDisplayId getCharMetafile(const void *pFont, OdUInt32 uChar, double *pSideMult=NULL)
OdRxObjectPtr tfcNewMetafile(void *pSessionId)
bool useStableFontKey() const
void setUseStableFontKey(OdTrVecDevice *pDevice)
void tfcPlayMetafile(const OdGeMatrix3d &xForm, const OdRxObject *pMetafile, void *pSessionId) const
TtfFont getFontCache(OdUInt64 fontKeyPartA, OdUInt64 fontKeyPartB) const
void tfcFinalizeMetafileExt(FontKey &fontKey, CharKey chr, OdRxObject *pMetafile, void *pSessionId)
OdDrawOrderMetafileBase & deviceRefs()
void setUseStableFontKey(bool bStableKey)