Commit 050ea5dc authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55198 954022d7-b5bf-4e40-9824-e11837661b57
parent e27ae074
#include "ApplicationFonts.h" #include "ApplicationFonts.h"
#include "../common/File.h" #include "../common/File.h"
#include "../common/Directory.h" #include "../common/Directory.h"
#include FT_SFNT_NAMES_H #include FT_SFNT_NAMES_H
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
CFontSelectFormat::CFontSelectFormat() CFontSelectFormat::CFontSelectFormat()
{ {
...@@ -199,7 +203,7 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir) ...@@ -199,7 +203,7 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
pBuffer += sizeof(BOOL); pBuffer += sizeof(BOOL);
// Panose // Panose
lLen = *((LONG*)pBuffer); // 10 lLen = *((LONG*)pBuffer); // должно быть равно 10
pBuffer += sizeof(LONG); pBuffer += sizeof(LONG);
BYTE pPanose[10]; BYTE pPanose[10];
...@@ -305,11 +309,11 @@ namespace NSCharsets ...@@ -305,11 +309,11 @@ namespace NSCharsets
{ {
static void GetCodePageByCharset(unsigned char unCharset, unsigned long *pulBit, unsigned int *punLongIndex) static void GetCodePageByCharset(unsigned char unCharset, unsigned long *pulBit, unsigned int *punLongIndex)
{ {
// , // Данная функция возвращает параметры, которые нужно посылать на вход
// AVSFontManager::IsUnicodeRangeAvailable // функции AVSFontManager::IsUnicodeRangeAvailable
// Charset -> Codepage: http://support.microsoft.com/kb/165478 // Соответствие Charset -> Codepage: http://support.microsoft.com/kb/165478
// http://msdn.microsoft.com/en-us/library/cc194829.aspx // http://msdn.microsoft.com/en-us/library/cc194829.aspx
// Charset Name Charset Value(hex) Codepage number // Charset Name Charset Value(hex) Codepage number
...@@ -335,7 +339,7 @@ namespace NSCharsets ...@@ -335,7 +339,7 @@ namespace NSCharsets
// VIETNAMESE_CHARSET 163 (xA3) 1258 // VIETNAMESE_CHARSET 163 (xA3) 1258
// MAC_CHARSET 77 (x4D) // MAC_CHARSET 77 (x4D)
// CodePage -> ulCodePageRange1 : http://www.microsoft.com/Typography/otspec/os2.htm#cpr // Соответсвие CodePage -> ulCodePageRange1 : http://www.microsoft.com/Typography/otspec/os2.htm#cpr
if ( punLongIndex ) if ( punLongIndex )
*punLongIndex = 4; *punLongIndex = 4;
...@@ -422,7 +426,7 @@ namespace NSCharsets ...@@ -422,7 +426,7 @@ namespace NSCharsets
int CFontList::GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset) int CFontList::GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset)
{ {
// Penalty = 65000 ( ) // Penalty = 65000 (это самый весомый параметр)
if ( UNKNOWN_CHARSET == unReqCharset ) if ( UNKNOWN_CHARSET == unReqCharset )
return 0; return 0;
...@@ -444,15 +448,15 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double ...@@ -444,15 +448,15 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double
{ {
double dPenalty = 0; double dPenalty = 0;
// . // Для начала просматриваем сколько вообще различных пространств надо.
// , 1 . // Исходя из их общего количества, находим вес 1 пропущеного пространства.
unsigned char arrCandidate[192], arrRequest[192]; unsigned char arrCandidate[192], arrRequest[192];
memset( arrCandidate, 0x00, 192 ); memset( arrCandidate, 0x00, 192 );
memset( arrRequest, 0x00, 192 ); memset( arrRequest, 0x00, 192 );
int nRangesCount = 0; // int nRangesCount = 0; // Количество необходимых пространств
int nAddCount = 0; // () int nAddCount = 0; // количество дополнительных(ненужных) пространств у кандидата
for ( int nIndex = 0; nIndex < 6; nIndex++ ) for ( int nIndex = 0; nIndex < 6; nIndex++ )
{ {
...@@ -495,8 +499,8 @@ int CFontList::GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed) ...@@ -495,8 +499,8 @@ int CFontList::GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed)
{ {
int nPenalty = 0; int nPenalty = 0;
// , , 15000 // Если запрашивается моноширинный, а кандидат не моноширинный, то вес 15000
// , , 350 // Если запрашивается не моноширинный, а кандидат моноширинный, то вес 350
if ( bReqFixed && !bCandFixed ) if ( bReqFixed && !bCandFixed )
nPenalty = 15000; nPenalty = 15000;
if ( !bReqFixed && bCandFixed ) if ( !bReqFixed && bCandFixed )
...@@ -506,10 +510,10 @@ int CFontList::GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed) ...@@ -506,10 +510,10 @@ int CFontList::GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed)
} }
int CFontList::GetFaceNamePenalty(std::wstring sCandName, std::wstring sReqName) int CFontList::GetFaceNamePenalty(std::wstring sCandName, std::wstring sReqName)
{ {
// MSDN , , 10000. // На MSDN написано, что если имена не совпадают, то вес 10000.
// // Мы будем сравнивать сколько совпало символов у запрашиваемого
// , , , // имени и с именем кандидата, без учета решистра, пробелов, запятых
// . // и тире.
/* /*
TODO: TODO:
...@@ -611,13 +615,13 @@ int CFontList::GetBoldPenalty(BOOL bCandBold, BOOL bReqBold) ...@@ -611,13 +615,13 @@ int CFontList::GetBoldPenalty(BOOL bCandBold, BOOL bReqBold)
int CFontList::GetFontFormatPenalty(EFontFormat eCandFormat, EFontFormat eReqFormat) int CFontList::GetFontFormatPenalty(EFontFormat eCandFormat, EFontFormat eReqFormat)
{ {
// , SDN TrueType. // Вообще, на МSDN написано только про TrueType. Но мы будем сравнивать
// = 4. // все типы форматов и при несовпадении даем вес = 4. Если формат не задан
// TrueType. // то по умолчанию считаем его TrueType.
if ( eReqFormat == fontUnknown ) if ( eReqFormat == fontUnknown )
{ {
// , , 100% TrueType. // Считаем, что когда формат не известен, значит это 100% не TrueType.
if ( eCandFormat == fontTrueType ) if ( eCandFormat == fontTrueType )
return 4; return 4;
else else
...@@ -719,8 +723,8 @@ CFontInfo* CFontList::GetByParams(const CFontSelectFormat& oSelect) ...@@ -719,8 +723,8 @@ CFontInfo* CFontList::GetByParams(const CFontSelectFormat& oSelect)
if (0 == nFontsCount) if (0 == nFontsCount)
return NULL; return NULL;
int nMinIndex = 0; // int nMinIndex = 0; // Номер шрифта в списке с минимальным весом
int nMinPenalty = 0; // int nMinPenalty = 0; // Минимальный вес
int nDefPenalty = 2147483647; int nDefPenalty = 2147483647;
...@@ -814,7 +818,7 @@ CFontInfo* CFontList::GetByParams(const CFontSelectFormat& oSelect) ...@@ -814,7 +818,7 @@ CFontInfo* CFontList::GetByParams(const CFontSelectFormat& oSelect)
nDefPenalty = nCurPenalty; nDefPenalty = nCurPenalty;
} }
// , , // Нашелся шрифт, удовлетворяющий всем параметрам, дальше искать нет смысла
if ( 0 == nCurPenalty ) if ( 0 == nCurPenalty )
break; break;
} }
...@@ -863,10 +867,10 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory) ...@@ -863,10 +867,10 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory)
if (FT_Open_Face( pLibrary, &oOpenArgs, 0, &pFace )) if (FT_Open_Face( pLibrary, &oOpenArgs, 0, &pFace ))
continue; continue;
// TO DO: , (.. // TO DO: Шрифты, которые нельзя скейлить (т.е. изменять размер
// ) . // произвольно) мы не грузим. Возможно в будущем надо будет
// , . ( Word // сделать, чтобы работал и такой вариант. (в Word такие шрифты
// ) // не используются)
if ( !( pFace->face_flags & FT_FACE_FLAG_SCALABLE ) ) if ( !( pFace->face_flags & FT_FACE_FLAG_SCALABLE ) )
{ {
FT_Done_Face( pFace ); FT_Done_Face( pFace );
...@@ -958,8 +962,8 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory) ...@@ -958,8 +962,8 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory)
if ( true ) if ( true )
{ {
// , charset // Специальная ветка для случаев, когда charset может быть задан не через значения
// ulCodePageRange, Cmap. // ulCodePageRange, а непосредственно через тип Cmap.
// Charset Name Charset Value(hex) Codepage number Platform_ID Encoding_ID Description // Charset Name Charset Value(hex) Codepage number Platform_ID Encoding_ID Description
// ------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------
...@@ -1139,4 +1143,4 @@ CFontManager* CApplicationFonts::GenerateFontManager() ...@@ -1139,4 +1143,4 @@ CFontManager* CApplicationFonts::GenerateFontManager()
CFontManager* pManager = new CFontManager(); CFontManager* pManager = new CFontManager();
pManager->m_pApplication = this; pManager->m_pApplication = this;
return pManager; return pManager;
} }
\ No newline at end of file
#ifndef _BUILD_APPLICATIONFONTS_H_ #ifndef _BUILD_APPLICATIONFONTS_H_
#define _BUILD_APPLICATIONFONTS_H_ #define _BUILD_APPLICATIONFONTS_H_
#define UNKNOWN_CHARSET 3 // , DEFAULT_CHARSET, #define UNKNOWN_CHARSET 3 // для случаев, когда задано значение DEFAULT_CHARSET, но
// charset // на самом деле charset не учитывается
#include "FontManager.h" #include "FontManager.h"
...@@ -54,7 +54,7 @@ enum EFontFormat ...@@ -54,7 +54,7 @@ enum EFontFormat
{ {
fontWindowsFNT = 0, // *.fon fontWindowsFNT = 0, // *.fon
fontTrueType = 1, // *.ttf fontTrueType = 1, // *.ttf
fontOpenType = 2, // *.ttf, *.otf (CFF ) fontOpenType = 2, // *.ttf, *.otf (CFF формат)
fontUnknown = 3 fontUnknown = 3
}; };
...@@ -88,17 +88,17 @@ public: ...@@ -88,17 +88,17 @@ public:
~CFontInfo(); ~CFontInfo();
BOOL Equals(const CFontInfo *pFontInfo); BOOL Equals(const CFontInfo *pFontInfo);
static CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir); static CFontInfo* FromBuffer(BYTE*& pBuffer, std::wstring strDir);
public: public:
std::wstring m_wsFontName; // std::wstring m_wsFontName; // Имя шрифта
std::wstring m_wsFontPath; // std::wstring m_wsFontPath; // Путь к файлу с шрифтом
long m_lIndex; // ( 1 ) long m_lIndex; // Номер шрифта в файле(если в файле больше 1 шрифта)
std::wstring m_wsStyle; std::wstring m_wsStyle;
BOOL m_bBold; // Bold text BOOL m_bBold; // Bold text
BOOL m_bItalic; // Italic text BOOL m_bItalic; // Italic text
BOOL m_bIsFixed; // ? BOOL m_bIsFixed; // Моноширинный шрифт?
BYTE m_aPanose[10]; BYTE m_aPanose[10];
ULONG m_ulUnicodeRange1; // Bits 0-31 ULONG m_ulUnicodeRange1; // Bits 0-31
...@@ -115,12 +115,12 @@ public: ...@@ -115,12 +115,12 @@ public:
SHORT m_sFamilyClass; SHORT m_sFamilyClass;
EFontFormat m_eFontFormat; EFontFormat m_eFontFormat;
SHORT m_shAvgCharWidth; // SHORT m_shAvgCharWidth; // Средняя ширина символов
SHORT m_shAscent; // Ascent SHORT m_shAscent; // Ascent
SHORT m_shDescent; // Descent SHORT m_shDescent; // Descent
SHORT m_shLineGap; // SHORT m_shLineGap; // Межсимвольный интервал
SHORT m_shXHeight; // 'x' ( ) SHORT m_shXHeight; // Высота буквы 'x' (в нижнем регистре)
SHORT m_shCapHeight; // 'H' ( ) SHORT m_shCapHeight; // Высота буквы 'H' (в верхнем регистре)
}; };
namespace NSCharsets namespace NSCharsets
...@@ -134,7 +134,7 @@ class CFontList ...@@ -134,7 +134,7 @@ class CFontList
private: private:
CArray<CFontInfo*> m_pList; CArray<CFontInfo*> m_pList;
std::wstring m_sDirectory; std::wstring m_sDirectory;
LONG m_lDefIndex; // (-1, ) LONG m_lDefIndex; // Номер стандартного шрифта (-1, если не задан)
private: private:
int GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset); int GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset);
...@@ -188,4 +188,4 @@ public: ...@@ -188,4 +188,4 @@ public:
CFontManager* GenerateFontManager(); CFontManager* GenerateFontManager();
}; };
#endif #endif
\ No newline at end of file
#include "FontManager.h" #include "FontManager.h"
#include "internal/internal.h" #include "internal/internal.h"
#include "internal/ftobjs.h" #include "internal/ftobjs.h"
#include "../common/Types.h"
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
CFontFile::CFontFile() CFontFile::CFontFile()
{ {
......
...@@ -195,8 +195,8 @@ public: ...@@ -195,8 +195,8 @@ public:
void AddToSizesCache(const TFontCacheSizes& oSizes); void AddToSizesCache(const TFontCacheSizes& oSizes);
int CFontFile::SetCMapForCharCode(long lUnicode, int *pnCMapIndex); int SetCMapForCharCode(long lUnicode, int *pnCMapIndex);
int CFontFile::SetCMapForCharCode2(long lUnicode); int SetCMapForCharCode2(long lUnicode);
int GetKerning(FT_UInt unPrevGID, FT_UInt unGID); int GetKerning(FT_UInt unPrevGID, FT_UInt unGID);
void SetStringGID(const BOOL& bGID); void SetStringGID(const BOOL& bGID);
......
#include "ApplicationFonts.h" #include "ApplicationFonts.h"
#include "../common/File.h" #include "../common/File.h"
#include <stdio.h> #include <stdio.h>
......
#ifndef _BUILD_FONT_ENGINE_FONTMANAGER_H_ #ifndef _BUILD_FONT_ENGINE_FONTMANAGER_H_
#define _BUILD_FONT_ENGINE_FONTMANAGER_H_ #define _BUILD_FONT_ENGINE_FONTMANAGER_H_
#include "FontFile.h" #include "FontFile.h"
...@@ -28,7 +28,7 @@ public: ...@@ -28,7 +28,7 @@ public:
class CApplicationFontStreams class CApplicationFontStreams
{ {
private: private:
// // этот мап нужно периодически опрашивать и удалять неиспользуемые стримы
std::map<std::wstring, CFontStream*> m_mapStreams; std::map<std::wstring, CFontStream*> m_mapStreams;
public: public:
......
#include "FontPath.h" #include "FontPath.h"
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
// CPath // CPath
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
// Path : // Path может быть в одном из трех следующий состояний:
// //
// 1. -- SubPaths // 1. Нет текущей точки -- ни одного или более законченных SubPaths
// [m_nCurSubpath == m_nPointsCount] // [m_nCurSubpath == m_nPointsCount]
// //
// 2. SubPaths // 2. Одна точка в SubPaths
// [m_nCurSubpath == m_nPointsCount - 1] // [m_nCurSubpath == m_nPointsCount - 1]
// //
// 3. SubPaths c // 3. Открытый SubPaths c двумя или более точками
// [m_nCurSubpath < m_nPointsCount - 1] // [m_nCurSubpath < m_nPointsCount - 1]
CFontPath::CFontPath() CFontPath::CFontPath()
......
#ifndef _PATH_H #ifndef _PATH_H
#define _PATH_H #define _PATH_H
#include "../common/Types.h" #include "../common/Types.h"
#include <memory> #include <memory>
#include <string.h>
#include <stdlib.h>
#include "ftimage.h" #include "ftimage.h"
class ISimpleGraphicsPath class ISimpleGraphicsPath
...@@ -28,16 +30,16 @@ struct TPathPoint ...@@ -28,16 +30,16 @@ struct TPathPoint
// CPath.nFlags // CPath.nFlags
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
// subpath // Флаг для первой точки любого subpath
#define PathFirst 0x01 #define PathFirst 0x01
// subpath // Флаг для последней точки любого subpath
#define PathLast 0x02 #define PathLast 0x02
// subpath , , // Если subpath замкнутый, тогда его последняя и первая точка должны совпадать, их флаг в данном случае следующий
#define PathClosed 0x04 #define PathClosed 0x04
// , , // Флаг, означающий, что данная точка является контрольной для кривой Безье
#define PathCurve 0x08 #define PathCurve 0x08
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
...@@ -61,12 +63,6 @@ class CFontPath ...@@ -61,12 +63,6 @@ class CFontPath
public: public:
CFontPath(); CFontPath();
CFontPath *opy()
{
return new CFontPath(this);
}
~CFontPath(); ~CFontPath();
void Append(CFontPath *pPath); void Append(CFontPath *pPath);
...@@ -98,7 +94,7 @@ public: ...@@ -98,7 +94,7 @@ public:
BOOL GetCurPoint(double *pdX, double *pdY); BOOL GetCurPoint(double *pdX, double *pdY);
// StrokeAdjust. // Добавляем флаг StrokeAdjust.
void AddStrokeAdjustHint(int nFirstControl, int nSecondControl, int nFirstPoint, int nLastPoint); void AddStrokeAdjustHint(int nFirstControl, int nSecondControl, int nFirstPoint, int nLastPoint);
BOOL ToInterface(ISimpleGraphicsPath* pPath); BOOL ToInterface(ISimpleGraphicsPath* pPath);
...@@ -122,12 +118,12 @@ private: ...@@ -122,12 +118,12 @@ private:
private: private:
TPathPoint *m_pPoints; // TPathPoint *m_pPoints; // Массив точек
unsigned char *m_pFlags; // , SubPath unsigned char *m_pFlags; // Массив флагов, указыающих значение точки в SubPath
int m_nPointsCount; // int m_nPointsCount; // Количество точек
int m_nSize; // int m_nSize; // Непосредственный размер массива
int m_nCurSubpath; // SubPath int m_nCurSubpath; // Номер первой точки последнего SubPath
TPathHint *m_pHints; // TPathHint *m_pHints; //
int m_nHintsCount; int m_nHintsCount;
......
#include "GlyphString.h" #include "GlyphString.h"
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
TGlyphBitmap::TGlyphBitmap() TGlyphBitmap::TGlyphBitmap()
{ {
...@@ -8,7 +16,7 @@ TGlyphBitmap::TGlyphBitmap() ...@@ -8,7 +16,7 @@ TGlyphBitmap::TGlyphBitmap()
nHeight = 0; nHeight = 0;
bAA = FALSE; bAA = FALSE;
pData = NULL; pData = NULL;
bFreeData = NULL; bFreeData = TRUE;
} }
TGlyphBitmap::~TGlyphBitmap() TGlyphBitmap::~TGlyphBitmap()
...@@ -291,7 +299,7 @@ void CGlyphString::GetBBox(float *pfLeft, float *pfTop, float *pfRight, float *p ...@@ -291,7 +299,7 @@ void CGlyphString::GetBBox(float *pfLeft, float *pfTop, float *pfRight, float *p
if ( 0 == nType && !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) ) if ( 0 == nType && !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) )
{ {
// BBox // Применяем глобальную матрицу преобразования и пересчитываем BBox
float arrfX[4] = { fLeft, fLeft, fRight, fRight }; float arrfX[4] = { fLeft, fLeft, fRight, fRight };
float arrfY[4] = { fTop, fBottom, fBottom, fTop }; float arrfY[4] = { fTop, fBottom, fBottom, fTop };
...@@ -349,7 +357,7 @@ void CGlyphString::GetBBox2(float *pfLeft, float *pfTop, float *pfRight, float * ...@@ -349,7 +357,7 @@ void CGlyphString::GetBBox2(float *pfLeft, float *pfTop, float *pfRight, float *
if ( !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) ) if ( !( 1 == m_arrCTM[0] && 0 == m_arrCTM[1] && 0 == m_arrCTM[2] && 1 == m_arrCTM[3] && 0 == m_arrCTM[4] && 0 == m_arrCTM[5] ) )
{ {
// BBox // Применяем глобальную матрицу преобразования и пересчитываем BBox
float arrfX[4] = { fLeft, fLeft, fRight, fRight }; float arrfX[4] = { fLeft, fLeft, fRight, fRight };
float arrfY[4] = { fTop, fBottom, fBottom, fTop }; float arrfY[4] = { fTop, fBottom, fBottom, fTop };
...@@ -454,4 +462,4 @@ BOOL CGlyphString::GetNext(TGlyph*& pGlyph) ...@@ -454,4 +462,4 @@ BOOL CGlyphString::GetNext(TGlyph*& pGlyph)
m_nGlyphIndex++; m_nGlyphIndex++;
return TRUE; return TRUE;
} }
\ No newline at end of file
#ifndef _BUILD_GLYPH_STRING_H #ifndef _BUILD_GLYPH_STRING_H
#define _BUILD_GLYPH_STRING_H #define _BUILD_GLYPH_STRING_H
#include "../common/Types.h" #include "../common/Types.h"
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
class TGlyphBitmap class TGlyphBitmap
{ {
public: public:
int nX; // X int nX; // Сдвиг по X начальной точки для рисования символа
int nY; // Y int nY; // Сдвиг по Y начальной точки для рисования символа
int nWidth; // int nWidth; // Ширина символа
int nHeight; // int nHeight; // Высота символа
BOOL bAA; // Anti-aliased: True , Bitmap 8-(.. ); False - Bitmap 1- BOOL bAA; // Anti-aliased: True означает, что Bitmap 8-битный(т.е. с альфой); False - Bitmap 1-битный
BYTE* pData; // Bitmap data( ) BYTE* pData; // Bitmap data(картинка с символом)
BOOL bFreeData; // True, pData BOOL bFreeData; // True, если память в pData нужно освободить
TGlyphBitmap(); TGlyphBitmap();
~TGlyphBitmap(); ~TGlyphBitmap();
...@@ -27,9 +27,9 @@ public: ...@@ -27,9 +27,9 @@ public:
enum EGlyphState enum EGlyphState
{ {
glyphstateNormal = 0, // glyphstateNormal = 0, // символ отрисовался в нужном шрифте
glyphstateDeafault, // glyphstateDeafault, // символ отрисовался в дефолтовом шрифте
glyphstateMiss // glyphstateMiss // символ не отрисовался
}; };
struct TBBox struct TBBox
...@@ -57,9 +57,9 @@ struct TMetrics ...@@ -57,9 +57,9 @@ struct TMetrics
class TGlyph class TGlyph
{ {
public: public:
long lUnicode; // long lUnicode; // Юникод
float fX; // float fX; // Позиция глифа
float fY; // BaseLine float fY; // на BaseLine
float fLeft; // float fLeft; //
float fTop; // BBox float fTop; // BBox
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
namespace FontConstants namespace FontConstants
{ {
//--------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------
// CharMap: Platform, Encoding ID // Константы связанные с CharMap: Platform, Encoding ID
//--------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------
const long c_lUniPlatform = 0; const long c_lUniPlatform = 0;
...@@ -154,19 +154,19 @@ public: ...@@ -154,19 +154,19 @@ public:
float m_fTransX; float m_fTransX;
float m_fTransY; float m_fTransY;
float m_fX; // float m_fX; // Координаты начальной точки для рисования
float m_fY; // float m_fY; //
float m_fEndX; // float m_fEndX; // Координаты конечной точки
float m_fEndY; // float m_fEndY; //
double m_arrCTM[6]; // double m_arrCTM[6]; // Глобальная матрица преобразования
double m_dIDet; // ( )^(-1) double m_dIDet; // (Детерминант матрицы преобразования)^(-1)
private: private:
TGlyph* m_pGlyphsBuffer; // TGlyph* m_pGlyphsBuffer; // Символы в данной строке
int m_nGlyphsCount; // int m_nGlyphsCount; // Количество символов в строке
int m_nGlyphIndex; // int m_nGlyphIndex; // Номер текущего символа
}; };
#endif /* _BUILD_GLYPH_STRING_H */ #endif /* _BUILD_GLYPH_STRING_H */
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment