Commit 3716449c authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Сделано ускорение записи подряд идущего текста. Сделано, чтобы в имя шрифта...

Сделано ускорение записи подряд идущего текста. Сделано, чтобы в имя шрифта при внедрении также записывался и стиль.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63285 954022d7-b5bf-4e40-9824-e11837661b57
parent 16dea3f9
......@@ -456,18 +456,6 @@ namespace NSOnlineOfficeBinToPdf
{
pPositions[lIndex] = ReadInt(current, curindex) / 100000.0;
pColors[lIndex] = ReadInt(current, curindex);
//BYTE _r = *current++;
//BYTE _g = *current++;
//BYTE _b = *current++;
//BYTE _a = *current++;
//curindex += 4;
//int _color = ((_b << 16) & 0xFF0000) | ((_g << 8) & 0xFF00) | _r;
//CString sColor;
//sColor.Format(L"<stop stop-color='%d' stop-opacity='%f' offset='%f' />", _color, _a / 255.0, dPos);
//strColors += sColor;
}
pPdf->put_BrushGradientColors(pColors, pPositions, lColorsCount);
......
This diff is collapsed.
......@@ -26,6 +26,9 @@ namespace Aggplus
class CFontManager;
class CApplicationFonts;
class CRendererCommandBase;
class CRendererTextCommand;
class CPdfRenderer : public IRenderer
{
public:
......@@ -1390,6 +1393,15 @@ private:
{
Reset();
}
void operator=(const CTransform& oT)
{
m11 = oT.m11;
m12 = oT.m12;
m21 = oT.m21;
m22 = oT.m22;
dx = oT.dx;
dy = oT.dy;
}
void Reset()
{
m11 = 1.0;
......@@ -1399,6 +1411,18 @@ private:
dx = 0;
dy = 0;
}
bool IsIdentity() const
{
if (abs(m11 - 1) < 0.001
&& abs(m12) < 0.001
&& abs(m21) < 0.001
&& abs(m22 - 1) < 0.001
&& abs(dx) < 0.001
&& abs(dy) < 0.001)
return true;
return false;
}
void Set(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY)
{
m11 = dM11;
......@@ -1418,6 +1442,22 @@ private:
double dx;
double dy;
};
class CCommandManager
{
public:
CCommandManager(CPdfRenderer* pRenderer);
~CCommandManager();
CRendererTextCommand* AddText(unsigned char* pCodes, unsigned int nLen, const double& dX, const double& dY);
void Flush();
void SetTransform(const CTransform& oTransform);
private:
void Add(CRendererCommandBase* pCommand);
void Clear();
private:
CPdfRenderer* m_pRenderer;
std::vector<CRendererCommandBase*> m_vCommands;
CTransform m_oTransform;
};
private:
......@@ -1432,6 +1472,14 @@ private:
PdfWriter::CShading* m_pShading;
PdfWriter::CExtGrState* m_pShadingExtGrState;
bool m_bNeedUpdateTextFont;
bool m_bNeedUpdateTextColor;
bool m_bNeedUpdateTextAlpha;
bool m_bNeedUpdateTextCharSpace;
bool m_bNeedUpdateTextSize;
CCommandManager m_oCommandManager;
CPenState m_oPen;
CBrushState m_oBrush;
CFontState m_oFont;
......
......@@ -918,7 +918,7 @@ void TestMetafile()
}
void TestOnlineBin()
{
std::wstring wsFolderPath = L"D://Test Files//Txt//IvanovaVeronica//";
std::wstring wsFolderPath = L"D://Test Files//Txt//Text//";
std::wstring wsTempFolder = L"D://Test Files//Temp//";
CApplicationFonts oFonts;
......
......@@ -307,8 +307,12 @@ namespace PdfWriter
}
// ,
std::string sFontName = m_pDocument->GetTTFontTag() + std::string(pFace->family_name);
if (pFace->style_flags & FT_STYLE_FLAG_ITALIC)
sFontName += "-Italic";
if (pFace->style_flags & FT_STYLE_FLAG_BOLD)
sFontName += "-Bold";
const char* sName = sFontName.c_str();
Add("BaseFont", sName);
......
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