Commit 167e347a authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov
parent 4c143cff
......@@ -565,8 +565,8 @@ INT CFontManager::GetStringPath(ISimpleGraphicsPath* pInterface)
pPath->Reverse();
pPath->ToMM(m_pFont->m_unHorDpi, m_pFont->m_unVerDpi);
pPath->Offset((pCurGlyph->fX + m_oString.m_fX) * 25.4 / m_pFont->m_unHorDpi,
(pCurGlyph->fY + m_oString.m_fY) * 25.4 / m_pFont->m_unVerDpi);
pPath->Offset(m_oString.m_fX + pCurGlyph->fX * 25.4 / m_pFont->m_unHorDpi,
m_oString.m_fY + pCurGlyph->fY + 25.4 / m_pFont->m_unVerDpi);
pOverallPath->Append(pPath);
delete pPath;
......
......@@ -154,7 +154,6 @@ namespace NSHtmlRenderer
HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
public:
void OnBaseMatrixUpdate(const double& dWidth, const double& dHeight);
void SetFontManager(CFontManager* pFontManager);
private:
......
......@@ -7,8 +7,8 @@ namespace NSHtmlRenderer
{
CASCSVGWriter::CASCSVGWriter()
{
m_dDpiX = 96.0;
m_dDpiY = 96.0;
m_dDpiX = 72;
m_dDpiY = 72;
m_dWidth = 100;
m_dHeight = 100;
......@@ -398,7 +398,15 @@ namespace NSHtmlRenderer
//-------- Функции для вывода текста --------------------------------------------------------
HRESULT CASCSVGWriter::CommandDrawTextCHAR(const LONG& c, const double& x, const double& y, const double& w, const double& h)
{
//todo new command
if (m_bIsRaster)
return S_OK;
PathCommandEnd();
BeginCommand(c_nPathType);
PathCommandTextCHAR(c, x, y, w, h);
DrawPath(c_nWindingFillMode);
EndCommand(c_nPathType);
PathCommandEnd();
return S_OK;
}
HRESULT CASCSVGWriter::CommandDrawText(const std::wstring& bsText,const double& x,const double& y,const double& w, const double& h)
......@@ -419,7 +427,15 @@ namespace NSHtmlRenderer
}
HRESULT CASCSVGWriter::CommandDrawTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h)
{
//todo new command
if (m_bIsRaster)
return S_OK;
PathCommandEnd();
BeginCommand(c_nPathType);
PathCommandTextExCHAR(c, gid, x, y, w, h);
DrawPath(c_nWindingFillMode);
EndCommand(c_nPathType);
PathCommandEnd();
return S_OK;
}
HRESULT CASCSVGWriter::CommandDrawTextEx(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h)
......@@ -615,7 +631,6 @@ namespace NSHtmlRenderer
_SetFont();
m_pSimpleGraphicsConverter->PathCommandText2(&_c, NULL, 0, m_pFontManager, x, y, w, h);
return S_OK;
}
HRESULT CASCSVGWriter::PathCommandText(const std::wstring& bsText, const double& fX, const double& fY, const double& fWidth, const double& fHeight)
......@@ -638,7 +653,6 @@ namespace NSHtmlRenderer
int _g = (int)gid;
m_pSimpleGraphicsConverter->PathCommandText2(&_c, &_g, 1, m_pFontManager, x, y, w, h);
return S_OK;
}
HRESULT CASCSVGWriter::PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h)
......@@ -647,8 +661,8 @@ namespace NSHtmlRenderer
return S_OK;
_SetFont();
m_pSimpleGraphicsConverter->PathCommandText2(sText, (const int*)pGids, nGidsCount, m_pFontManager, x, y, w, h);
m_pSimpleGraphicsConverter->PathCommandText2(sText, (const int*)pGids, nGidsCount, m_pFontManager, x, y, w, h);
return S_OK;
}
//-------- Функции для вывода изображений ---------------------------------------------------
......@@ -769,8 +783,8 @@ namespace NSHtmlRenderer
}
HRESULT CASCSVGWriter::ReInit()
{
m_dDpiX = 96.0;
m_dDpiY = 96.0;
m_dDpiX = 72.0;
m_dDpiY = 72.0;
m_dWidth = 100;
m_dHeight = 100;
......@@ -822,20 +836,6 @@ namespace NSHtmlRenderer
return S_OK;
}
// --------------------------------------------------------------------------------------------
void CASCSVGWriter::OnBaseMatrixUpdate(const double& dWidth, const double& dHeight)
{
m_pBaseTransform->Reset();
double dScaleX = m_dDpiX / NSHtmlRenderer::c_ag_Inch_to_MM;
double dScaleY = m_dDpiY / NSHtmlRenderer::c_ag_Inch_to_MM;
m_pBaseTransform->Scale(dScaleX, dScaleY, Aggplus::MatrixOrderAppend);
CalculateFullTransform();
double dWidthPix = dScaleX * dWidth;
double dHeightPix = dScaleY * dHeight;
}
void CASCSVGWriter::SetFontManager(CFontManager* pFontManager)
{
if(NULL != pFontManager)
......
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