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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50007 954022d7-b5bf-4e40-9824-e11837661b57
parent 2a0ec961
/** @define {boolean} */ /** @define {boolean} */
var ASC_DOCS_API_USE_FONTS_ORIGINAL_FORMAT = false; var ASC_DOCS_API_USE_FONTS_ORIGINAL_FORMAT = true;
var bIsLocalFontsUse = false; var bIsLocalFontsUse = false;
...@@ -392,8 +392,11 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex ...@@ -392,8 +392,11 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex
this.indexBI = indexBI; this.indexBI = indexBI;
this.faceIndexBI= faceIndexBI; this.faceIndexBI= faceIndexBI;
this.needBI = false; this.needBI = false;
}
this.CheckFontLoadStyles = function(global_loader) CFontInfo.prototype =
{
CheckFontLoadStyles : function(global_loader)
{ {
if ((this.NeedStyles & 0x0F) == 0x0F) if ((this.NeedStyles & 0x0F) == 0x0F)
{ {
...@@ -523,9 +526,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex ...@@ -523,9 +526,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex
} }
return isNeed; return isNeed;
} },
this.CheckFontLoadStylesNoLoad = function(global_loader) CheckFontLoadStylesNoLoad : function(global_loader)
{ {
var fonts = (FONT_TYPE_EMBEDDED == this.Type) ? global_loader.embeddedFontFiles : global_loader.fontFiles; var fonts = (FONT_TYPE_EMBEDDED == this.Type) ? global_loader.embeddedFontFiles : global_loader.fontFiles;
var _isNeed = false; var _isNeed = false;
...@@ -547,9 +550,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex ...@@ -547,9 +550,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex
} }
return _isNeed; return _isNeed;
} },
this.LoadFontsFromServer = function(global_loader) LoadFontsFromServer : function(global_loader)
{ {
var fonts = global_loader.fontFiles; var fonts = global_loader.fontFiles;
var basePath = global_loader.fontFilesPath; var basePath = global_loader.fontFilesPath;
...@@ -569,33 +572,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex ...@@ -569,33 +572,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex
{ {
fonts[this.indexBI].LoadFontAsync(basePath, null); fonts[this.indexBI].LoadFontAsync(basePath, null);
} }
} },
this.check_fonts_loaded_sync = function(global_loader) LoadFont : function(font_loader, fontManager, fEmSize, lStyle, dHorDpi, dVerDpi, transform)
{
var fonts = global_loader.fontFiles;
var isNeed = false;
if ((this.needR === true) && (-1 != this.indexR) && (fonts[this.indexR].CheckLoaded() === false))
{
isNeed = true;
}
if ((this.needI === true) && (-1 != this.indexI) && (fonts[this.indexI].CheckLoaded() === false))
{
isNeed = true;
}
if ((this.needB === true) && (-1 != this.indexB) && (fonts[this.indexB].CheckLoaded() === false))
{
isNeed = true;
}
if ((this.needBI === true) && (-1 != this.indexBI) && (fonts[this.indexBI].CheckLoaded() === false))
{
isNeed = true;
}
return isNeed;
}
this.LoadFont = function(font_loader, fontManager, fEmSize, lStyle, dHorDpi, dVerDpi, transform)
{ {
// сначала нужно проверить на обрезанный шрифт // сначала нужно проверить на обрезанный шрифт
var _embedded_cur = g_font_loader.embedded_cut_manager; var _embedded_cur = g_font_loader.embedded_cut_manager;
...@@ -800,9 +779,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex ...@@ -800,9 +779,9 @@ function CFontInfo(sName, thumbnail, type, indexR, faceIndexR, indexI, faceIndex
} }
fontManager.AfterLoad(); fontManager.AfterLoad();
} },
this.GetFontID = function(font_loader, lStyle) GetFontID : function(font_loader, lStyle)
{ {
// подбираем шрифт по стилю // подбираем шрифт по стилю
var sReturnName = this.Name; var sReturnName = this.Name;
......
...@@ -241,21 +241,6 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false; ...@@ -241,21 +241,6 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false;
} }
} }
this.CheckFontsPaste = function(_fonts)
{
for (var i in _fonts)
{
var info_ind = this.map_font_index[_fonts[i]];
if (info_ind != undefined)
{
this.fonts_loading[this.fonts_loading.length] = this.fontInfos[info_ind];
}
}
this.Api.asyncFontsDocumentStartLoaded();
this._LoadFonts();
}
this.AddLoadFonts = function(info, need_styles) this.AddLoadFonts = function(info, need_styles)
{ {
this.fonts_loading[this.fonts_loading.length] = info; this.fonts_loading[this.fonts_loading.length] = info;
...@@ -329,9 +314,25 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false; ...@@ -329,9 +314,25 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false;
this.Api.asyncFontsDocumentStartLoaded(); this.Api.asyncFontsDocumentStartLoaded();
this.bIsLoadDocumentFirst = true; this.bIsLoadDocumentFirst = true;
this.CheckFontsNeedLoadingLoad();
this._LoadFonts(); this._LoadFonts();
} }
this.CheckFontsNeedLoadingLoad = function()
{
var _fonts = this.fonts_loading;
var _fonts_len = _fonts.length;
var _need = false;
for (var i = 0; i < _fonts_len; i++)
{
if (true == _fonts[i].CheckFontLoadStyles(this))
_need = true;
}
return _need;
}
this.CheckFontsNeedLoading = function(_fonts) this.CheckFontsNeedLoading = function(_fonts)
{ {
for (var i in _fonts) for (var i in _fonts)
...@@ -358,6 +359,7 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false; ...@@ -358,6 +359,7 @@ var ASC_DOCS_API_USE_OPEN_SOURCE_FONTS_ONLY = false;
else else
this.ThemeLoader.asyncFontsStartLoaded(); this.ThemeLoader.asyncFontsStartLoaded();
this.CheckFontsNeedLoadingLoad();
this._LoadFonts(); this._LoadFonts();
} }
......
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