Commit a1557615 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@60940 954022d7-b5bf-4e40-9824-e11837661b57
parent 48492f5c
...@@ -317,12 +317,6 @@ function CTextMeasurer() ...@@ -317,12 +317,6 @@ function CTextMeasurer()
this.m_oFont = font; this.m_oFont = font;
if (-1 == font.FontFamily.Index || undefined === font.FontFamily.Index || null == font.FontFamily.Index)
font.FontFamily.Index = window.g_map_font_index[font.FontFamily.Name];
if (font.FontFamily.Index == undefined || font.FontFamily.Index == -1)
return;
var bItalic = true === font.Italic; var bItalic = true === font.Italic;
var bBold = true === font.Bold; var bBold = true === font.Bold;
...@@ -335,13 +329,13 @@ function CTextMeasurer() ...@@ -335,13 +329,13 @@ function CTextMeasurer()
oFontStyle = FontStyle.FontStyleBoldItalic; oFontStyle = FontStyle.FontStyleBoldItalic;
var _lastSetUp = this.m_oLastFont; var _lastSetUp = this.m_oLastFont;
if (_lastSetUp.SetUpIndex != font.FontFamily.Index || _lastSetUp.SetUpSize != font.FontSize || _lastSetUp.SetUpStyle != oFontStyle) if (_lastSetUp.SetUpName != font.FontFamily.Name || _lastSetUp.SetUpSize != font.FontSize || _lastSetUp.SetUpStyle != oFontStyle)
{ {
_lastSetUp.SetUpIndex = font.FontFamily.Index; _lastSetUp.SetUpName = font.FontFamily.Name;
_lastSetUp.SetUpSize = font.FontSize; _lastSetUp.SetUpSize = font.FontSize;
_lastSetUp.SetUpStyle = oFontStyle; _lastSetUp.SetUpStyle = oFontStyle;
window.g_font_infos[_lastSetUp.SetUpIndex].LoadFont(window.g_font_loader, this.m_oManager, _lastSetUp.SetUpSize, _lastSetUp.SetUpStyle, 72, 72); g_fontApplication.LoadFont(_lastSetUp.SetUpName, window.g_font_loader, this.m_oManager, _lastSetUp.SetUpSize, _lastSetUp.SetUpStyle, 72, 72);
} }
} }
...@@ -368,11 +362,6 @@ function CTextMeasurer() ...@@ -368,11 +362,6 @@ function CTextMeasurer()
_lastFont.Name = _rfonts.Ascii.Name; _lastFont.Name = _rfonts.Ascii.Name;
_lastFont.Index = _rfonts.Ascii.Index; _lastFont.Index = _rfonts.Ascii.Index;
if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{
_lastFont.Index = window.g_map_font_index[_lastFont.Name];
}
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
_lastFont.Bold = this.m_oTextPr.Bold; _lastFont.Bold = this.m_oTextPr.Bold;
_lastFont.Italic = this.m_oTextPr.Italic; _lastFont.Italic = this.m_oTextPr.Italic;
...@@ -384,11 +373,6 @@ function CTextMeasurer() ...@@ -384,11 +373,6 @@ function CTextMeasurer()
_lastFont.Name = _rfonts.CS.Name; _lastFont.Name = _rfonts.CS.Name;
_lastFont.Index = _rfonts.CS.Index; _lastFont.Index = _rfonts.CS.Index;
if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{
_lastFont.Index = window.g_map_font_index[_lastFont.Name];
}
_lastFont.Size = this.m_oTextPr.FontSizeCS; _lastFont.Size = this.m_oTextPr.FontSizeCS;
_lastFont.Bold = this.m_oTextPr.BoldCS; _lastFont.Bold = this.m_oTextPr.BoldCS;
_lastFont.Italic = this.m_oTextPr.ItalicCS; _lastFont.Italic = this.m_oTextPr.ItalicCS;
...@@ -400,11 +384,6 @@ function CTextMeasurer() ...@@ -400,11 +384,6 @@ function CTextMeasurer()
_lastFont.Name = _rfonts.EastAsia.Name; _lastFont.Name = _rfonts.EastAsia.Name;
_lastFont.Index = _rfonts.EastAsia.Index; _lastFont.Index = _rfonts.EastAsia.Index;
if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{
_lastFont.Index = window.g_map_font_index[_lastFont.Name];
}
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
_lastFont.Bold = this.m_oTextPr.Bold; _lastFont.Bold = this.m_oTextPr.Bold;
_lastFont.Italic = this.m_oTextPr.Italic; _lastFont.Italic = this.m_oTextPr.Italic;
...@@ -417,11 +396,6 @@ function CTextMeasurer() ...@@ -417,11 +396,6 @@ function CTextMeasurer()
_lastFont.Name = _rfonts.HAnsi.Name; _lastFont.Name = _rfonts.HAnsi.Name;
_lastFont.Index = _rfonts.HAnsi.Index; _lastFont.Index = _rfonts.HAnsi.Index;
if (_lastFont.Index == -1 || _lastFont.Index === undefined)
{
_lastFont.Index = window.g_map_font_index[_lastFont.Name];
}
_lastFont.Size = this.m_oTextPr.FontSize; _lastFont.Size = this.m_oTextPr.FontSize;
_lastFont.Bold = this.m_oTextPr.Bold; _lastFont.Bold = this.m_oTextPr.Bold;
_lastFont.Italic = this.m_oTextPr.Italic; _lastFont.Italic = this.m_oTextPr.Italic;
...@@ -439,13 +413,13 @@ function CTextMeasurer() ...@@ -439,13 +413,13 @@ function CTextMeasurer()
if (_lastFont.Bold) if (_lastFont.Bold)
_style += 1; _style += 1;
if (_lastFont.Index != _lastFont.SetUpIndex || _lastFont.Size != _lastFont.SetUpSize || _style != _lastFont.SetUpStyle) if (_lastFont.Name != _lastFont.SetUpName || _lastFont.Size != _lastFont.SetUpSize || _style != _lastFont.SetUpStyle)
{ {
_lastFont.SetUpIndex = _lastFont.Index; _lastFont.SetUpName = _lastFont.Name;
_lastFont.SetUpSize = _lastFont.Size; _lastFont.SetUpSize = _lastFont.Size;
_lastFont.SetUpStyle = _style; _lastFont.SetUpStyle = _style;
window.g_font_infos[_lastFont.SetUpIndex].LoadFont(window.g_font_loader, this.m_oManager, _lastFont.SetUpSize, _lastFont.SetUpStyle, 72, 72); g_fontApplication.LoadFont(_lastFont.SetUpName, window.g_font_loader, this.m_oManager, _lastFont.SetUpSize, _lastFont.SetUpStyle, 72, 72);
} }
} }
...@@ -3890,7 +3864,7 @@ function CThumbnailsManager() ...@@ -3890,7 +3864,7 @@ function CThumbnailsManager()
else if ( bItalic && bBold ) else if ( bItalic && bBold )
oFontStyle = FontStyle.FontStyleBoldItalic; oFontStyle = FontStyle.FontStyleBoldItalic;
window.g_font_infos[font.FontFamily.Index].LoadFont(window.g_font_loader, this.m_oFontManager, font.FontSize, oFontStyle, 96, 96); g_fontApplication.LoadFont(font.FontFamily.Name, window.g_font_loader, this.m_oFontManager, font.FontSize, oFontStyle, 96, 96);
} }
this.Init = function() this.Init = function()
......
...@@ -32,6 +32,8 @@ CErrorData.prototype.get_Value = function() { return this.Value; }; ...@@ -32,6 +32,8 @@ CErrorData.prototype.get_Value = function() { return this.Value; };
function asc_docs_api(name) function asc_docs_api(name)
{ {
g_fontApplication.Init();
var CDocsCoApi = window["CDocsCoApi"]; var CDocsCoApi = window["CDocsCoApi"];
var CSpellCheckApi = window["CSpellCheckApi"]; var CSpellCheckApi = window["CSpellCheckApi"];
...@@ -1724,8 +1726,7 @@ asc_docs_api.prototype.sync_SearchEndCallback = function(){ ...@@ -1724,8 +1726,7 @@ asc_docs_api.prototype.sync_SearchEndCallback = function(){
asc_docs_api.prototype.put_TextPrFontName = function(name) asc_docs_api.prototype.put_TextPrFontName = function(name)
{ {
var loader = window.g_font_loader; var loader = window.g_font_loader;
var nIndex = loader.map_font_index[name]; var fontinfo = g_fontApplication.GetFontInfo(name);
var fontinfo = loader.fontInfos[nIndex];
var isasync = loader.LoadFont(fontinfo); var isasync = loader.LoadFont(fontinfo);
if (false === isasync) if (false === isasync)
{ {
......
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