07405f7de6
- aggiunta gestione buchi alle triangolazione di poligoni - creazione suerfici trimesh da regioni con buchi.
67 lines
2.5 KiB
C++
67 lines
2.5 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/EGnStringBase.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) ;
|
|
bool GetAscent( double& dAsc) ;
|
|
bool GetDescent( double& dDesc) ;
|
|
bool GetXBox( const std::string& sText, int nInsPos, bool bCapOrBound, BBox3d& b3Box) ;
|
|
bool GetOutline( const std::string& sText, int nInsPos, ICURVEPLIST& lstPC) ;
|
|
bool ApproxWithLines( const std::string& sText, int nInsPos, double dLinTol, double dAngTolDeg,
|
|
POLYLINELIST& lstPL) ;
|
|
bool ApproxWithArcs( const std::string& sText, int nInsPos, double dLinTol, double dAngTolDeg,
|
|
POLYARCLIST& lstPA) ;
|
|
bool GetTextLines( const std::string& sText, int nInsPos, PNTVECTOR& vPt, STRVECTOR& vLine) ;
|
|
|
|
private :
|
|
bool CalcFontData( void) ;
|
|
bool GetCharAdvance( unsigned int nChar, double& dAdvance) ;
|
|
bool GetCharOutline( unsigned int nChar, double& dAdvance, ICURVEPLIST& lstPC) ;
|
|
bool AddLineToCompo( ICurveComposite* pCCompo, const Point3d& ptStart, const Point3d& ptEnd) ;
|
|
bool AddCBezierQuadToCompo( ICurveComposite* pCCompo,
|
|
const Point3d& ptStart, const Point3d& ptMid, const Point3d& ptEnd) ;
|
|
|
|
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 ;
|
|
} ;
|