Commit 3dd1dcb5 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@61167 954022d7-b5bf-4e40-9824-e11837661b57
parent 0ad1c794
......@@ -814,22 +814,35 @@ function CDefaultFont()
this.m_arrDefaultFont = new Array(4);
this.SetDefaultFont = function(sFamilyName)
{
var fontInfo = window.g_font_infos[map_font_index[sFamilyName]];
var fontInfo = g_fontApplication.GetFontInfo(sFamilyName);
var font = null;
font = window.g_font_infos[fontInfo.indexR];
var _defaultIndex = fontInfo.indexR;
if (-1 == _defaultIndex)
_defaultIndex = fontInfo.indexI;
if (-1 == _defaultIndex)
_defaultIndex = fontInfo.indexB;
if (-1 == _defaultIndex)
_defaultIndex = fontInfo.indexBI;
var _indexR = fontInfo.indexR != -1 ? fontInfo.indexR : _defaultIndex;
var _indexI = fontInfo.indexI != -1 ? fontInfo.indexI : _defaultIndex;
var _indexB = fontInfo.indexB != -1 ? fontInfo.indexB : _defaultIndex;
var _indexBI = fontInfo.indexBI != -1 ? fontInfo.indexBI : _defaultIndex;
font = window.g_font_infos[_indexR];
this.m_arrDefaultFont[0] = this.m_oLibrary.LoadFont(font.stream_index, font.id, fontInfo.faceIndexR);
this.m_arrDefaultFont[0].UpdateStyles(false, false);
font = window.g_font_infos[fontInfo.indexB];
font = window.g_font_infos[_indexB];
this.m_arrDefaultFont[1] = this.m_oLibrary.LoadFont(font.stream_index, font.id, fontInfo.faceIndexB);
this.m_arrDefaultFont[1].UpdateStyles(true, false);
font = window.g_font_infos[fontInfo.indexI];
font = window.g_font_infos[_indexI];
this.m_arrDefaultFont[2] = this.m_oLibrary.LoadFont(font.stream_index, font.id, fontInfo.faceIndexI);
this.m_arrDefaultFont[2].UpdateStyles(false, true);
font = window.g_font_infos[fontInfo.indexBI];
font = window.g_font_infos[_indexBI];
this.m_arrDefaultFont[3] = this.m_oLibrary.LoadFont(font.stream_index, font.id, fontInfo.faceIndexBI);
this.m_arrDefaultFont[3].UpdateStyles(true, true);
}
......
......@@ -5048,17 +5048,8 @@ PasteProcessor.prototype =
//todo ��������� �����, ������ �� ��������
var oFontItem = this.oFonts[font_family];
//���� ����� ����� �������
var index = this.map_font_index[oFontItem.Name];
if(null != index)
{
this.oFonts[font_family].Index = index;
aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0));
}
else
{
this.oFonts[font_family] = {Name:"Arial", Index: -1};
aPrepeareFonts.push(new CFont("Arial", 0, "", 0));
}
this.oFonts[font_family].Index = -1;
aPrepeareFonts.push(new CFont(oFontItem.Name, 0, "", 0));
};
return aPrepeareFonts;
......@@ -5068,14 +5059,6 @@ PasteProcessor.prototype =
{
if(!fonts)
return;
for(var i = 0; i < fonts.length; i++)
{
var index = this.map_font_index[fonts[i].name];
if(null == index || undefined == index)
{
fonts[i] = new CFont("Arial", 0, "", 0);
}
}
return fonts;
},
_IsBlockElem : function(name)
......
......@@ -320,7 +320,7 @@
{
for (var i in _fonts)
{
var info = this.fontInfos[this.map_font_index[_fonts[i].name]];
var info = g_fontApplication.GetFontInfo(_fonts[i].name);
var _isNeed = info.CheckFontLoadStylesNoLoad(this);
if (_isNeed === true)
return true;
......@@ -480,10 +480,9 @@
var _count = _fonts.length;
for (var i = 0; i < _count; i++)
{
var _info_ind = this.map_font_index[_fonts[i]];
if (undefined !== _info_ind)
var _info = g_fontApplication.GetFontInfo(_fonts[i]);
if (undefined !== _info)
{
var _info = this.fontInfos[_info_ind];
_info.LoadFontsFromServer(this);
}
}
......
......@@ -11604,7 +11604,7 @@ CFontsCharMap.prototype =
StartFont : function(family, bold, italic, size)
{
var _index = window.g_map_font_index[family];
var font_info = g_fontApplication.GetFontInfo(family);
var bItalic = (true === italic);
var bBold = (true === bold);
......@@ -11617,7 +11617,6 @@ CFontsCharMap.prototype =
else if ( bItalic && bBold )
oFontStyle = FontStyle.FontStyleBoldItalic;
var font_info = window.g_font_infos[_index];
var _id = font_info.GetFontID(window.g_font_loader, oFontStyle);
var _find_index = _id.id + "_teamlab_" + _id.faceIndex;
......
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