CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrVecTtfFontsCache.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 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"
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
43class OdTrVecDevice;
44
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
75 OdTrVisRawTexturePtr getCharTexture(const void* pFont, OdUInt32 uChar, double* pSideMult = NULL);
76
77 void shareToNew(OdTrVecDevice *pDevice);
78
79 OdRxObjectPtr tfcNewMetafile(void *pSessionId);
80 OdGiConveyorGeometry *tfcBeginMetafile(OdRxObject *pMetafile, void *pSessionId);
81 void tfcFinalizeMetafileExt(FontKey &fontKey, CharKey chr, OdRxObject *pMetafile, void *pSessionId);
82 void tfcFinalizeMetafile(OdRxObject *pMetafile, void *pSessionId);
83 void tfcPlayMetafile(const OdGeMatrix3d &xForm, const OdRxObject *pMetafile, void *pSessionId) const;
84 protected:
85 OdUInt64 getFontKey(const OdGiTextStyle *pTextStyle) const;
86 TtfFont getFontCache(OdUInt64 fontKeyPartA, OdUInt64 fontKeyPartB) const
87 { return (TtfFont)getFontCache(FontKey(fontKeyPartA, fontKeyPartB)); }
88 OdTrVisDisplayId getCharMetafile(TtfFont pFont, OdUInt32 uChar, double *pSideMult = NULL) const
89 { return const_cast<OdTrVecTtfFontsCache*>(this)->getCharMetafile((const void *)pFont, uChar, pSideMult); }
90
100 OdTrVisRawTexturePtr getCharTexture(TtfFont pFont, OdUInt32 uChar, double* pSideMult = NULL) const ODRX_OVERRIDE
101 {
102 return const_cast<OdTrVecTtfFontsCache*>(this)->getCharTexture((const void*)pFont, uChar, pSideMult);
103 }
104};
105
106#include "TD_PackPop.h"
107
108#endif // ODTRVECTTFFONTSCACHE
unsigned int OdUInt32
#define ODRX_OVERRIDE
#define OD_TTFFONTSCACHE_SHAREABLENAMESPACE
OdTrVisId OdTrVisDisplayId
Definition TrVisDefs.h:114
std::shared_ptr< OdTrVisRawTexture > OdTrVisRawTexturePtr
OdUInt64 getFontKey(const OdGiTextStyle *pTextStyle) const
void shareToNew(OdTrVecDevice *pDevice)
OdTrVisDisplayId getCharMetafile(TtfFont pFont, OdUInt32 uChar, double *pSideMult=NULL) const
void tfcFinalizeMetafile(OdRxObject *pMetafile, void *pSessionId)
OdStaticRxObject< OdDrawOrderMetafileBase > m_deviceRefs
OdDrawOrderMetafileBase & deviceRefs()
OdGiConveyorGeometry * tfcBeginMetafile(OdRxObject *pMetafile, void *pSessionId)
OdTrVisDisplayId getCharMetafile(const void *pFont, OdUInt32 uChar, double *pSideMult=NULL)
OdRxObjectPtr tfcNewMetafile(void *pSessionId)
OdTrVisRawTexturePtr getCharTexture(TtfFont pFont, OdUInt32 uChar, double *pSideMult=NULL) const ODRX_OVERRIDE
void setUseStableFontKey(OdTrVecDevice *pDevice)
void tfcPlayMetafile(const OdGeMatrix3d &xForm, const OdRxObject *pMetafile, void *pSessionId) const
const void * getFontCache(const FontKey &fontKey) const
TtfFont getFontCache(OdUInt64 fontKeyPartA, OdUInt64 fontKeyPartB) const
OdTrVisRawTexturePtr getCharTexture(const void *pFont, OdUInt32 uChar, double *pSideMult=NULL)
void tfcFinalizeMetafileExt(FontKey &fontKey, CharKey chr, OdRxObject *pMetafile, void *pSessionId)
void setUseStableFontKey(bool bStableKey)