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

подбор шрифтов и по ranges

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@60193 954022d7-b5bf-4e40-9824-e11837661b57
parent 0fd13eb6
...@@ -536,7 +536,7 @@ int CFontList::GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqChars ...@@ -536,7 +536,7 @@ int CFontList::GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqChars
return 0; return 0;
} }
int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double dRangeWeight, bool bPenaltyForSuperflouous) int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double dRangeWeight, double dRangeWeightSuferflouous)
{ {
double dPenalty = 0; double dPenalty = 0;
...@@ -581,8 +581,8 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double ...@@ -581,8 +581,8 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double
{ {
if ( 1 == arrRequest[nIndex] && 0 == arrCandidate[nIndex] ) if ( 1 == arrRequest[nIndex] && 0 == arrCandidate[nIndex] )
dPenalty += dRangeWeight; dPenalty += dRangeWeight;
else if ( bPenaltyForSuperflouous && 0 == arrRequest[nIndex] && 1 == arrCandidate[nIndex] ) else if ( dRangeWeightSuferflouous != 0 && 0 == arrRequest[nIndex] && 1 == arrCandidate[nIndex] )
dPenalty += dRangeWeight; dPenalty += dRangeWeightSuferflouous;
} }
return (int)dPenalty; return (int)dPenalty;
...@@ -837,7 +837,7 @@ CFontInfo* CFontList::GetByParams(CFontSelectFormat& oSelect) ...@@ -837,7 +837,7 @@ CFontInfo* CFontList::GetByParams(CFontSelectFormat& oSelect)
ULONG arrCandRanges[6] = { pInfo->m_ulUnicodeRange1, pInfo->m_ulUnicodeRange2, pInfo->m_ulUnicodeRange3, pInfo->m_ulUnicodeRange4, pInfo->m_ulCodePageRange1, pInfo->m_ulCodePageRange2 }; ULONG arrCandRanges[6] = { pInfo->m_ulUnicodeRange1, pInfo->m_ulUnicodeRange2, pInfo->m_ulUnicodeRange3, pInfo->m_ulUnicodeRange4, pInfo->m_ulCodePageRange1, pInfo->m_ulCodePageRange2 };
if (false) if (true)
{ {
if (NULL != oSelect.ulRange1 && if (NULL != oSelect.ulRange1 &&
NULL != oSelect.ulRange2 && NULL != oSelect.ulRange2 &&
...@@ -847,7 +847,7 @@ CFontInfo* CFontList::GetByParams(CFontSelectFormat& oSelect) ...@@ -847,7 +847,7 @@ CFontInfo* CFontList::GetByParams(CFontSelectFormat& oSelect)
NULL != oSelect.ulCodeRange2) NULL != oSelect.ulCodeRange2)
{ {
ULONG arrReqRanges[6] = { *oSelect.ulRange1, *oSelect.ulRange2, *oSelect.ulRange3, *oSelect.ulRange4, *oSelect.ulCodeRange1, *oSelect.ulCodeRange2 }; ULONG arrReqRanges[6] = { *oSelect.ulRange1, *oSelect.ulRange2, *oSelect.ulRange3, *oSelect.ulRange4, *oSelect.ulCodeRange1, *oSelect.ulCodeRange2 };
nCurPenalty += GetSigPenalty( arrCandRanges, arrReqRanges ); nCurPenalty += GetSigPenalty( arrCandRanges, arrReqRanges, nCurPenalty >= 1000 ? 50 : 10, 10 );
} }
} }
......
...@@ -156,7 +156,7 @@ public: ...@@ -156,7 +156,7 @@ public:
private: private:
int GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset); int GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset);
int GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double dRangeWeight = 1, bool bPenaltyForSuperflouous = false); int GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double dRangeWeight = 1, double dRangeWeightSuferflouous = 0);
int GetFixedPitchPenalty(INT bCandFixed, INT bReqFixed); int GetFixedPitchPenalty(INT bCandFixed, INT bReqFixed);
int GetFaceNamePenalty(std::wstring sCandName, std::wstring sReqName); int GetFaceNamePenalty(std::wstring sCandName, std::wstring sReqName);
int GetFamilyUnlikelyPenalty(SHORT nCandFamilyClass, SHORT nReqFamilyClass); int GetFamilyUnlikelyPenalty(SHORT nCandFamilyClass, SHORT nReqFamilyClass);
......
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