e6d64e2c60
- a ExtText aggiunta GetAuxSurf (solo per font di sistema) - molto migliorata gestione anelli e spikes nella creazione di regioni.
69 lines
2.7 KiB
C++
69 lines
2.7 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : FontOs.h Data : 05.06.14 Versione : 1.5f2
|
|
// Contenuto : Dichiarazione della classe OsFont (font di sistema).
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 01.06.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkCurve.h"
|
|
#include "/EgtDev/Include/EGkSurfFlatRegion.h"
|
|
#include "/EgtDev/Include/EgtStringBase.h"
|
|
#define NOMINMAX
|
|
#include <Windows.h>
|
|
#include <WinGDI.h>
|
|
|
|
class ICurveComposite ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class OsFont
|
|
{
|
|
public :
|
|
OsFont( void) ;
|
|
~OsFont( void) ;
|
|
bool SetCurrFont( const std::string& sFontPath, int nWeight, bool bItalic,
|
|
double dHeight, double dRatio, double dAddAdvance) ;
|
|
bool GetCapHeight( double& dCapH) const ;
|
|
bool GetAscent( double& dAsc) const ;
|
|
bool GetDescent( double& dDesc) const ;
|
|
bool GetXBox( const std::string& sText, int nInsPos, bool bCapOrBound, BBox3d& b3Box) const ;
|
|
bool GetOutline( const std::string& sText, int nInsPos, ICURVEPLIST& lstPC) const ;
|
|
bool GetRegion( const std::string& sText, int nInsPos, ISURFFRPLIST& lstSFR) const ;
|
|
bool ApproxWithLines( const std::string& sText, int nInsPos, double dLinTol, double dAngTolDeg,
|
|
POLYLINELIST& lstPL) const ;
|
|
bool ApproxWithArcs( const std::string& sText, int nInsPos, double dLinTol, double dAngTolDeg,
|
|
POLYARCLIST& lstPA) const ;
|
|
bool GetTextLines( const std::string& sText, int nInsPos, PNTVECTOR& vPt, STRVECTOR& vLine) const ;
|
|
|
|
private :
|
|
bool CalcFontData( void) ;
|
|
bool GetCharAdvance( unsigned int nChar, double& dAdvance) const ;
|
|
bool GetCharOutline( unsigned int nChar, double& dAdvance, ICURVEPLIST& lstPC) const ;
|
|
bool AddLineToCompo( ICurveComposite* pCCompo, const Point3d& ptStart, const Point3d& ptEnd) const ;
|
|
bool AddCBezierQuadToCompo( ICurveComposite* pCCompo,
|
|
const Point3d& ptStart, const Point3d& ptMid, const Point3d& ptEnd) const ;
|
|
|
|
private :
|
|
HDC m_hDC ;
|
|
HFONT m_hFont ;
|
|
std::string m_sFont ;
|
|
int m_nWeight ;
|
|
bool m_bItalic ;
|
|
double m_dHeight ;
|
|
double m_dRatio ;
|
|
double m_dAddAdvance ;
|
|
double m_dH ;
|
|
double m_dHCap ;
|
|
double m_dHx ;
|
|
double m_dAsc ;
|
|
double m_dDesc ;
|
|
double m_dAdv ;
|
|
} ;
|