Commit 1ad8f23b authored by Alexey.Musinov's avatar Alexey.Musinov Committed by Alexander.Trofimov

[ios] tables

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63687 954022d7-b5bf-4e40-9824-e11837661b57
parent ce6dc344
...@@ -399,21 +399,8 @@ ...@@ -399,21 +399,8 @@
this.setCanvas(settings.canvas); this.setCanvas(settings.canvas);
var ppiTest = this.ppiX = 96.0 * this.deviceScale * (96.0 / (this.deviceDPI * this.deviceScale));
$('<div style="position: absolute; width: 10in; height:10in; visibility:hidden; padding:0;"/>') this.ppiY = 96.0 * this.deviceScale * (96.0 / (this.deviceDPI * this.deviceScale));
.appendTo("body");
this.ppiX = asc_round(ppiTest[0] ? (ppiTest[0].offsetWidth * 0.1) : 96);
this.ppiY = asc_round(ppiTest[0] ? (ppiTest[0].offsetHeight * 0.1) : 96);
if (AscBrowser.isRetina) {
this.ppiX <<= 1;
this.ppiY <<= 1;
}
this.ppiX = parseInt(this.ppiX * this.deviceScale, 10);
this.ppiY = parseInt(this.ppiY * this.deviceScale, 10);
ppiTest.remove();
this._mct = new Matrix(); // units transform this._mct = new Matrix(); // units transform
this._mt = new Matrix(); // user transform this._mt = new Matrix(); // user transform
...@@ -422,8 +409,6 @@ ...@@ -422,8 +409,6 @@
this._mift = new Matrix(); // inverted full transform this._mift = new Matrix(); // inverted full transform
this._im = new Matrix(); this._im = new Matrix();
this.nppiX = parseInt(this.ppiX * this.deviceScale, 10);
this.scaleFactor = 1; this.scaleFactor = 1;
this.units = 3/*mm*/; this.units = 3/*mm*/;
...@@ -824,8 +809,7 @@ ...@@ -824,8 +809,7 @@
* @return {FontMetrics} * @return {FontMetrics}
*/ */
DrawingContext.prototype.getFontMetrics = function (units) { DrawingContext.prototype.getFontMetrics = function (units) {
var fm = this.napi_fmt[3];//this.fmgrGraphics[3]; var fm = this.napi_fmt[3];
var d = Math.abs(fm.m_lDescender); var d = Math.abs(fm.m_lDescender);
var r = getCvtRatio(0/*px*/, units >= 0 && units <=3 ? units : this.units, this.ppiX); var r = getCvtRatio(0/*px*/, units >= 0 && units <=3 ? units : this.units, this.ppiX);
var factor = this.getFontSize() * r / fm.m_lUnits_Per_Em; var factor = this.getFontSize() * r / fm.m_lUnits_Per_Em;
...@@ -835,20 +819,12 @@ ...@@ -835,20 +819,12 @@
res.descender = factor * d; res.descender = factor * d;
res.lineGap = factor * (fm.m_lLineHeight - fm.m_lAscender - d); res.lineGap = factor * (fm.m_lLineHeight - fm.m_lAscender - d);
//var face = fm.m_pFont.m_pFace; var face = g_oTextMeasurer.Measurer['GetFace']();
res.nat_scale = 2048;//face.header.Units_Per_EM; res.nat_scale = face[0];
res.nat_y1 = face[1];
res.nat_y2 = face[2];
res.nat_y1 = 2000; return res;
res.nat_y2 = -500;
// if (face.os2) {
// res.nat_y1 = face.os2.usWinAscent;
// res.nat_y2 = -face.os2.usWinDescent;
// } else {
// res.nat_y1 = face.header.yMax;
// res.nat_y2 = face.header.yMin;
// }
return res;
}; };
/** /**
...@@ -863,10 +839,8 @@ ...@@ -863,10 +839,8 @@
this.font.copyFrom(font); this.font.copyFrom(font);
// sample: 132 (ipad) * device_scale(is_retina=2) / 96 (default) * 2.54 this.font.FontSize = this.font.FontSize * 2.54 * this.scaleFactor *
this.deviceScale * this.deviceDPI / 96.0 * (96.0 / (this.deviceDPI * this.deviceScale));
///var rel = this.ppiX / this.nppiX
this.font.FontSize = this.font.FontSize * this.deviceDPI * this.deviceScale / this.nppiX * 2.54 * this.scaleFactor * this.deviceScale;// * rel;
italic = true === font.Italic; italic = true === font.Italic;
bold = true === font.Bold; bold = true === font.Bold;
...@@ -882,10 +856,6 @@ ...@@ -882,10 +856,6 @@
var _fontinfo, _info, flag, napi_fontInfo; var _fontinfo, _info, flag, napi_fontInfo;
if (angle && 0 != angle) { if (angle && 0 != angle) {
//r = g_fontApplication.LoadFont(font.FontFamily.Name, window.g_font_loader, this.fmgrGraphics[1], font.FontSize, fontStyle, this.ppiX, this.ppiY);
//===================================================================
_fontinfo = g_fontApplication.GetFontInfo(this.font.FontFamily.Name, fontStyle, this.LastFontOriginInfo); _fontinfo = g_fontApplication.GetFontInfo(this.font.FontFamily.Name, fontStyle, this.LastFontOriginInfo);
_info = GetLoadInfoForMeasurer(_fontinfo, fontStyle); _info = GetLoadInfoForMeasurer(_fontinfo, fontStyle);
...@@ -903,18 +873,11 @@ ...@@ -903,18 +873,11 @@
this.napi_fmt[1].m_lLineHeight = napi_fontInfo[2]; this.napi_fmt[1].m_lLineHeight = napi_fontInfo[2];
r = true; r = true;
//===================================================================
this.fmgrGraphics[1].SetTextMatrix( this.fmgrGraphics[1].SetTextMatrix(
this._mt.sx, this._mt.shy, this._mt.shx, this._mt.sy, this._mt.tx, this._mt.ty); this._mt.sx, this._mt.shy, this._mt.shx, this._mt.sy, this._mt.tx, this._mt.ty);
} else { } else {
// r = g_fontApplication.LoadFont(font.FontFamily.Name, window.g_font_loader, this.fmgrGraphics[0], font.FontSize, fontStyle, this.ppiX, this.ppiY);
// g_fontApplication.LoadFont(font.FontFamily.Name, window.g_font_loader, this.fmgrGraphics[3], font.FontSize, fontStyle, this.ppiX, this.ppiY);
//===================================================================
_fontinfo = g_fontApplication.GetFontInfo(this.font.FontFamily.Name, fontStyle, this.LastFontOriginInfo); _fontinfo = g_fontApplication.GetFontInfo(this.font.FontFamily.Name, fontStyle, this.LastFontOriginInfo);
_info = GetLoadInfoForMeasurer(_fontinfo, fontStyle); _info = GetLoadInfoForMeasurer(_fontinfo, fontStyle);
...@@ -928,6 +891,16 @@ ...@@ -928,6 +891,16 @@
this.nctx["PD_LoadFont"](_info.Path, _info.FaceIndex, this.font.FontSize, flag); this.nctx["PD_LoadFont"](_info.Path, _info.FaceIndex, this.font.FontSize, flag);
this.napi_fmt[0].m_lUnits_Per_Em = napi_fontInfo[3];
this.napi_fmt[0].m_lAscender = napi_fontInfo[0];
this.napi_fmt[0].m_lDescender = napi_fontInfo[2];
this.napi_fmt[0].m_lLineHeight = napi_fontInfo[2];
this.napi_fmt[3].m_lUnits_Per_Em = napi_fontInfo[3];
this.napi_fmt[3].m_lAscender = napi_fontInfo[0];
this.napi_fmt[3].m_lDescender = napi_fontInfo[2];
this.napi_fmt[3].m_lLineHeight = napi_fontInfo[2];
//var dKoef = g_dKoef_pt_to_mm * font.FontSize / napi_fontInfo[3]; //var dKoef = g_dKoef_pt_to_mm * font.FontSize / napi_fontInfo[3];
// //
//this.napi_fmt[0].m_lUnits_Per_Em = napi_fontInfo[3]; //this.napi_fmt[0].m_lUnits_Per_Em = napi_fontInfo[3];
......
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