Commit 7ca36eaf 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@54304 954022d7-b5bf-4e40-9824-e11837661b57
parent d6ce1323
......@@ -115,7 +115,12 @@ CDrawingDocument.prototype =
// convert coords
ConvertCoordsToCursorWR : function(x, y, pageIndex, transform)
{
var _return = this.Native["ConvertCoordsToCursor"](x, y, pageIndex, transform);
var _return = null;
if (!transform)
_return = this.Native["ConvertCoordsToCursor"](x, y, pageIndex);
else
_return = this.Native["ConvertCoordsToCursor"](x, y, pageIndex,
transform.sx, transform.shy, transform.shx, transform.sy, transform.tx, transform.ty);
return { X : _return[0], Y : _return[1], Error: _return[2] };
},
......
This diff is collapsed.
This diff is collapsed.
......@@ -53,7 +53,7 @@ CTextMeasurerWrapper.prototype =
_lastSetUp.SetUpSize = font.FontSize;
_lastSetUp.SetUpStyle = oFontStyle;
var _info = this.GetLoadInfoForMeasurer(window.g_font_infos[_lastSetUp.SetUpIndex], _lastSetUp.SetUpStyle);
var _info = GetLoadInfoForMeasurer(window.g_font_infos[_lastSetUp.SetUpIndex], _lastSetUp.SetUpStyle);
var flag = 0;
if (_info.NeedBold) flag |= 0x01;
if (_info.NeedItalic) flag |= 0x02;
......@@ -164,7 +164,7 @@ CTextMeasurerWrapper.prototype =
_lastFont.SetUpSize = _lastFont.Size;
_lastFont.SetUpStyle = _style;
var _info = this.GetLoadInfoForMeasurer(window.g_font_infos[_lastFont.SetUpIndex], _lastFont.SetUpStyle);
var _info = GetLoadInfoForMeasurer(window.g_font_infos[_lastFont.SetUpIndex], _lastFont.SetUpStyle);
var flag = 0;
if (_info.NeedBold) flag |= 0x01;
if (_info.NeedItalic) flag |= 0x02;
......@@ -226,150 +226,150 @@ CTextMeasurerWrapper.prototype =
GetHeight : function()
{
return this.Height;
},
}
};
GetLoadInfoForMeasurer : function(info, lStyle)
{
// подбираем шрифт по стилю
var sReturnName = info.Name;
var bNeedBold = false;
var bNeedItalic = false;
function GetLoadInfoForMeasurer(info, lStyle)
{
// подбираем шрифт по стилю
var sReturnName = info.Name;
var bNeedBold = false;
var bNeedItalic = false;
var index = -1;
var faceIndex = 0;
var index = -1;
var faceIndex = 0;
var bSrcItalic = false;
var bSrcBold = false;
var bSrcItalic = false;
var bSrcBold = false;
switch (lStyle)
switch (lStyle)
{
case FontStyle.FontStyleBoldItalic:
{
case FontStyle.FontStyleBoldItalic:
bSrcItalic = true;
bSrcBold = true;
bNeedBold = true;
bNeedItalic = true;
if (-1 != info.indexBI)
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedBold = false;
bNeedItalic = false;
}
else if (-1 != info.indexB)
{
bSrcItalic = true;
bSrcBold = true;
index = info.indexB;
faceIndex = info.faceIndexB;
bNeedBold = false;
}
else if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
bNeedItalic = false;
}
else
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
break;
}
case FontStyle.FontStyleBold:
{
bSrcBold = true;
bNeedBold = true;
bNeedItalic = true;
if (-1 != info.indexBI)
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedBold = false;
bNeedItalic = false;
}
else if (-1 != info.indexB)
{
index = info.indexB;
faceIndex = info.faceIndexB;
bNeedBold = false;
}
else if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
bNeedItalic = false;
}
else
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
break;
bNeedBold = true;
bNeedItalic = false;
if (-1 != info.indexB)
{
index = info.indexB;
faceIndex = info.faceIndexB;
bNeedBold = false;
}
else if (-1 != info.indexR)
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
case FontStyle.FontStyleBold:
else if (-1 != info.indexBI)
{
bSrcBold = true;
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedBold = false;
}
else
{
index = info.indexI;
faceIndex = info.faceIndexI;
}
break;
}
case FontStyle.FontStyleItalic:
{
bSrcItalic = true;
bNeedBold = true;
bNeedBold = false;
bNeedItalic = true;
if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
bNeedItalic = false;
if (-1 != info.indexB)
{
index = info.indexB;
faceIndex = info.faceIndexB;
bNeedBold = false;
}
else if (-1 != info.indexR)
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
else if (-1 != info.indexBI)
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedBold = false;
}
else
{
index = info.indexI;
faceIndex = info.faceIndexI;
}
break;
}
case FontStyle.FontStyleItalic:
else if (-1 != info.indexR)
{
bSrcItalic = true;
bNeedBold = false;
bNeedItalic = true;
if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
bNeedItalic = false;
}
else if (-1 != info.indexR)
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
else if (-1 != info.indexBI)
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedItalic = false;
}
else
{
index = info.indexB;
faceIndex = info.faceIndexB;
}
break;
index = info.indexR;
faceIndex = info.faceIndexR;
}
case FontStyle.FontStyleRegular:
else if (-1 != info.indexBI)
{
bNeedBold = false;
index = info.indexBI;
faceIndex = info.faceIndexBI;
bNeedItalic = false;
if (-1 != info.indexR)
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
else if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
}
else if (-1 != info.indexB)
{
index = info.indexB;
faceIndex = info.faceIndexB;
}
else
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
}
}
else
{
index = info.indexB;
faceIndex = info.faceIndexB;
}
break;
}
case FontStyle.FontStyleRegular:
{
bNeedBold = false;
bNeedItalic = false;
if (-1 != info.indexR)
{
index = info.indexR;
faceIndex = info.faceIndexR;
}
else if (-1 != info.indexI)
{
index = info.indexI;
faceIndex = info.faceIndexI;
}
else if (-1 != info.indexB)
{
index = info.indexB;
faceIndex = info.faceIndexB;
}
else
{
index = info.indexBI;
faceIndex = info.faceIndexBI;
}
}
return {
Path : window.g_font_files[index].Id,
FaceIndex : faceIndex,
NeedBold : bNeedBold,
NeedItalic : bNeedItalic,
SrcBold : bSrcBold,
SrcItalic : bSrcItalic
};
}
};
\ No newline at end of file
return {
Path : window.g_font_files[index].Id,
FaceIndex : faceIndex,
NeedBold : bNeedBold,
NeedItalic : bNeedItalic,
SrcBold : bSrcBold,
SrcItalic : bSrcItalic
};
}
\ No newline at end of file
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