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

fonts cache (needBold/needItalic)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51981 954022d7-b5bf-4e40-9824-e11837661b57
parent 4a881b87
......@@ -664,9 +664,11 @@ function CFontFilesCache()
this.m_lCurrentSize = 0;
this.Fonts = {};
this.LockFont = function(stream_index, fontName, faceIndex, fontSize)
this.LockFont = function(stream_index, fontName, faceIndex, fontSize, _ext)
{
var key = fontName + faceIndex + fontSize;
if (undefined !== _ext)
key += _ext;
var pFontFile = this.Fonts[key];
if (pFontFile)
return pFontFile;
......
......@@ -367,9 +367,15 @@ function GenerateMapId(api, name, style, size)
}
}
var _ext = "";
if (bNeedBold)
_ext += "nbold";
if (bNeedItalic)
_ext += "nitalic";
// index != -1 (!!!)
var fontfile = api.FontLoader.fontFiles[index];
return fontfile.Id + faceIndex + size;
return fontfile.Id + faceIndex + size + _ext;
}
function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndexI, indexB, faceIndexB, indexBI, faceIndexBI)
......@@ -747,7 +753,13 @@ CFontInfo.prototype =
}
}
var pFontFile = fontManager.m_oFontsCache.LockFont(fontfile.stream_index, fontfile.Id, faceIndex, fEmSize);
var _ext = "";
if (bNeedBold)
_ext += "nbold";
if (bNeedItalic)
_ext += "nitalic";
var pFontFile = fontManager.m_oFontsCache.LockFont(fontfile.stream_index, fontfile.Id, faceIndex, fEmSize, _ext);
if (!pFontFile)
pFontFile = fontManager.m_oDefaultFont.GetDefaultFont(bSrcBold, bSrcItalic);
......
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