Commit 7c4fa8bc authored by David Quiroz Marin's avatar David Quiroz Marin Committed by Commit Bot

Fix font.Width function for RTL and update actualBoundingBox

The current implementation of font.Width has a problem with RTL text
with spaces. Additionally, this fix allows to update canvas textMetrics
actualBoundingBox which should return the minimum bounding box
that covers all strokes/ink.

Bug:277215

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: If8815d640836d334381072b385d7fa8474a6ec45
Reviewed-on: https://chromium-review.googlesource.com/1179244Reviewed-by: default avatarFernando Serboncini <fserb@chromium.org>
Commit-Queue: David Quiroz Marin <davidqu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585850}
parent 82b3d458
......@@ -28,11 +28,10 @@ function getMetric(ctx, text, baseline, align, rtl, metric) {
}
}
function testMetric(name, ctx, text, baseline, align, rtl, metric, expected_value, epsilon = 0) {
function testMetric(name, ctx, text, baseline, align, rtl, metric, expected_value, epsilon = 0.3) {
const value = getMetric(ctx, text, baseline, align, rtl, metric);
assert_approx_equals(value, expected_value, epsilon ? Math.ceil(epsilon * expected_value) : 1.0,
name + ": " + metric + " for '" + text +
"' (" + baseline + ", " + align + ")");
assert_approx_equals(value, expected_value, Math.ceil(Math.abs(epsilon * expected_value)) + 10,
name + ": " + metric + " for '" + text + "' (" + baseline + ", " + align + ")");
return value;
}
......@@ -43,13 +42,13 @@ const kBaselines = ['top','hanging','middle','alphabetic',
// Those bbox are given from alphabetic,left.
// bbox = [ left, right, ascent, descent ].
const kTexts = [
{ text: "", bbox: [0, 0, 0, 0], rtl: false },
{ text: "hello", bbox: [0, 101, 35, 1], rtl: false },
{ text: "gypsy", bbox: [0, 122, 24, 12], rtl: false },
{ text: "傳統是假的", bbox: [0, 250, 42, 7], rtl: false },
{ text: "フェミニズム", bbox: [0, 300, 42, 3], rtl: false },
{ text: "एक आम भाषा", bbox: [0, 240, 34, 5], rtl: false },
{ text: "ليس في اسمنا", bbox: [0, 221, 41, 12], rtl: true },
{ text: "", width: 0, bbox: [0, 0, 0, 0], rtl: false },
{ text: "hello", width: 100, bbox: [0, 99, 35, 1], rtl: false },
{ text: "gypsy", width: 122, bbox: [-1, 122, 23, 12], rtl: false },
{ text: "傳統是假的", width: 250, bbox: [-1, 247, 43, 5], rtl: false },
{ text: "フェミニズム", width: 300, bbox: [-7, 297, 43, 3], rtl: false },
{ text: "एक आम भाषा", width: 250, bbox: [1, 251, 35, 7], rtl: false },
{ text: "ليس في اسمنا", width: 301, bbox: [-4, 297, 38, 13], rtl: true },
]
function forEachExample(fn) {
......@@ -65,7 +64,7 @@ function forEachExample(fn) {
// Widths shouldn't change over baseline/align.
function testWidth(ctx) {
forEachExample((ex, bline, align) => {
testMetric("width", ctx, ex.text, bline, align, ex.rtl, "width", ex.bbox[1] + ex.bbox[0]);
testMetric("width", ctx, ex.text, bline, align, ex.rtl, "width", ex.width);
});
}
......@@ -73,12 +72,11 @@ function testWidth(ctx) {
// match the returned values with a big confidence interval.
// If it does, we adapt to the actual values to accomodate for different OSes.
function testAndFixBasicExpectations(ctx) {
const max_diff = 0.75;
for (const ex of kTexts) {
ex.bbox[0] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxLeft", ex.bbox[0], max_diff);
ex.bbox[1] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxRight", ex.bbox[1], max_diff);
ex.bbox[2] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxAscent", ex.bbox[2], max_diff);
ex.bbox[3] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxDescent", ex.bbox[3], max_diff);
ex.bbox[0] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxLeft", ex.bbox[0]);
ex.bbox[1] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxRight", ex.bbox[1]);
ex.bbox[2] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxAscent", ex.bbox[2]);
ex.bbox[3] = testMetric("expectations", ctx, ex.text, "alphabetic", "left", ex.rtl, "actualBoundingBoxDescent", ex.bbox[3]);
}
}
......@@ -118,28 +116,28 @@ function testBoundingBox(ctx) {
// Left changes depending on what is the alignment.
forEachExample((ex, bline, align) => {
let left = 0;
let left = ex.bbox[0];
let calign = align;
if (align == "start") calign = ex.rtl ? "right" : "left";
if (align == "end") calign = ex.rtl ? "left" : "right";
if (calign == "left") left = 0;
else if (calign == "right") left = ex.bbox[1] + ex.bbox[0];
else if (calign == "center") left = (ex.bbox[1] + ex.bbox[0])/2.0;
if (calign == "left") left = ex.bbox[0];
else if (calign == "right") left = ex.bbox[0] + ex.width
else if (calign == "center") left = (ex.bbox[0] + ex.width)/2.0;
testMetric("boundigbox alignment", ctx, ex.text, bline, align, ex.rtl, "actualBoundingBoxLeft", left);
});
// Right changes depending on what is the alignment.
forEachExample((ex, bline, align) => {
let right = 0;
let right = ex.bbox[0];
let calign = align;
if (align == "start") calign = ex.rtl ? "right" : "left";
if (align == "end") calign = ex.rtl ? "left" : "right";
if (calign == "left") right = ex.bbox[1] + ex.bbox[0];
else if (calign == "right") right = 0;
else if (calign == "center") right = (ex.bbox[1] + ex.bbox[0])/2.0;
if (calign == "left") right = ex.bbox[0] + ex.width;
else if (calign == "right") right = ex.bbox[0];
else if (calign == "center") right = (ex.bbox[0] + ex.width)/2.0;
testMetric("boundingbox alignment", ctx, ex.text, bline, align, ex.rtl, "actualBoundingBoxRight", right);
});
......
......@@ -3,8 +3,8 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (78.50,133.19) size 303x21.59 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (78.50,133.19) size 303x21.59
LayoutSVGText {text} at (78.50,133.19) size 303.59x21.59 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (78.50,133.19) size 303.59x21.59
chunk 1 (middle anchor) text run 1 at (78.50,150.00) startOffset 0 endOffset 35 width 303.00 RTL override: "W3C \x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} dirRTL ubOverride!"
LayoutSVGText {text} at (20,171) size 85.19x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (20,171) size 85.19x11.39
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (266.30,133.19) size 111.59x21.59
chunk 1 (middle anchor) text run 1 at (266.30,150.00) startOffset 0 endOffset 14 width 111.60 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (82.09,133.19) size 295.80x21.59
LayoutSVGInlineText {#text} at (93.48,133.19) size 172.80x21.59
LayoutSVGInlineText {#text} at (92.30,133.19) size 173.98x21.59
chunk 1 (middle anchor) text run 1 at (93.50,150.00) startOffset 0 endOffset 8 width 50.40 RTL: ", \x{627}\x{62E}\x{62A}\x{628}\x{627}\x{631}"
chunk 1 (middle anchor) text run 1 at (143.90,150.00) startOffset 0 endOffset 13 width 122.40: "dirLTR ubNone"
LayoutSVGInlineText {#text} at (82.09,133.19) size 11.39x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (284.59,133.19) size 111.59x21.59
chunk 1 (middle anchor) text run 1 at (284.60,150.00) startOffset 0 endOffset 14 width 111.60 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (63.80,133.19) size 332.39x21.59
LayoutSVGInlineText {#text} at (75.19,133.19) size 209.39x21.59
LayoutSVGInlineText {#text} at (74,133.19) size 210.59x21.59
chunk 1 (middle anchor) text run 1 at (75.20,150.00) startOffset 0 endOffset 26 width 209.40 RTL override: "dirNone ubOverride, \x{627}\x{62E}\x{62A}\x{628}\x{627}\x{631}"
LayoutSVGInlineText {#text} at (63.80,133.19) size 11.39x21
chunk 1 (middle anchor) text run 1 at (63.80,150.00) startOffset 0 endOffset 2 width 11.40 RTL: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (68.59,133.19) size 160.19x21
chunk 1 (middle anchor) text run 1 at (68.60,150.00) startOffset 0 endOffset 19 width 160.20: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (68.59,133.19) size 322.80x21.59
LayoutSVGInlineText {#text} at (228.80,133.19) size 151.80x21.59
LayoutSVGInlineText {#text} at (228.80,133.19) size 151.19x21.59
chunk 1 (middle anchor) text run 1 at (228.80,150.00) startOffset 0 endOffset 17 width 151.20 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (380,133.19) size 11.39x21
chunk 1 (middle anchor) text run 1 at (380.00,150.00) startOffset 0 endOffset 2 width 11.40: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (68.59,133.19) size 160.19x21
chunk 1 (middle anchor) text run 1 at (68.60,150.00) startOffset 0 endOffset 19 width 160.20: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (68.59,133.19) size 322.80x21.59
LayoutSVGInlineText {#text} at (228.80,133.19) size 151.80x21.59
LayoutSVGInlineText {#text} at (228.80,133.19) size 151.19x21.59
chunk 1 (middle anchor) text run 1 at (228.80,150.00) startOffset 0 endOffset 17 width 151.20 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (380,133.19) size 11.39x21
chunk 1 (middle anchor) text run 1 at (380.00,150.00) startOffset 0 endOffset 2 width 11.40: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (279.19,133.19) size 111.59x21.59
chunk 1 (middle anchor) text run 1 at (279.20,150.00) startOffset 0 endOffset 14 width 111.60 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (69.19,133.19) size 321.59x21.59
LayoutSVGInlineText {#text} at (80.59,133.19) size 198.59x21.59
LayoutSVGInlineText {#text} at (79.39,133.19) size 199.80x21.59
chunk 1 (middle anchor) text run 1 at (80.60,150.00) startOffset 0 endOffset 25 width 198.60 RTL override: "dirRTL ubOverride, \x{627}\x{62E}\x{62A}\x{628}\x{627}\x{631}"
LayoutSVGInlineText {#text} at (69.19,133.19) size 11.39x21
chunk 1 (middle anchor) text run 1 at (69.20,150.00) startOffset 0 endOffset 2 width 11.40 RTL: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (273.50,133.19) size 111.59x21.59
chunk 1 (middle anchor) text run 1 at (273.50,150.00) startOffset 0 endOffset 14 width 111.60 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (74.89,133.19) size 310.19x21.59
LayoutSVGInlineText {#text} at (86.30,133.19) size 187.19x21.59
LayoutSVGInlineText {#text} at (85.09,133.19) size 188.39x21.59
chunk 1 (middle anchor) text run 1 at (86.30,150.00) startOffset 0 endOffset 8 width 50.40 RTL: ", \x{627}\x{62E}\x{62A}\x{628}\x{627}\x{631}"
chunk 1 (middle anchor) text run 1 at (136.70,150.00) startOffset 0 endOffset 14 width 136.80: "dirRTL ubEmbed"
LayoutSVGInlineText {#text} at (74.89,133.19) size 11.39x21
......
......@@ -2,7 +2,7 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (18.59,41) size 442.80x181.39
LayoutSVGContainer {g} at (18.59,41) size 443.41x181.39
LayoutSVGText {text} at (240,41) size 221.39x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (240,41) size 221.39x11.39
chunk 1 text run 1 at (240.00,50.00) startOffset 0 endOffset 56 width 220.80 LTR override: "Text \"\x{5D0}\x{5E0}\x{5D9} \x{5D9}\x{5DB}\x{5D5}\x{5DC} \x{5DC}\x{5D0}\x{5DB}\x{5D5}\x{5DC} \x{5D6}\x{5DB}\x{5D5}\x{5DB}\x{5D9}\x{5EA} \x{5D5}\x{5D6}\x{5D4} \x{5DC}\x{5D0} \x{5DE}\x{5D6}\x{5D9}\x{5E7} \x{5DC}\x{5D9}\" is in Hebrew"
......@@ -12,12 +12,12 @@ layer at (0,0) size 800x600
LayoutSVGText {text} at (19.19,101) size 221.39x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (19.19,101) size 221.39x11.39
chunk 1 (end anchor) text run 1 at (19.20,110.00) startOffset 0 endOffset 56 width 220.80 LTR override: "Text \"\x{5D0}\x{5E0}\x{5D9} \x{5D9}\x{5DB}\x{5D5}\x{5DC} \x{5DC}\x{5D0}\x{5DB}\x{5D5}\x{5DC} \x{5D6}\x{5DB}\x{5D5}\x{5DB}\x{5D9}\x{5EA} \x{5D5}\x{5D6}\x{5D4} \x{5DC}\x{5D0} \x{5DE}\x{5D6}\x{5D9}\x{5E7} \x{5DC}\x{5D9}\" is in Hebrew"
LayoutSVGText {text} at (18.59,141) size 221.39x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (18.59,141) size 221.39x11.39
LayoutSVGText {text} at (18.59,141) size 222x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (18.59,141) size 222x11.39
chunk 1 text run 1 at (18.60,150.00) startOffset 0 endOffset 56 width 221.40 RTL override: "Text \"\x{5D0}\x{5E0}\x{5D9} \x{5D9}\x{5DB}\x{5D5}\x{5DC} \x{5DC}\x{5D0}\x{5DB}\x{5D5}\x{5DC} \x{5D6}\x{5DB}\x{5D5}\x{5DB}\x{5D9}\x{5EA} \x{5D5}\x{5D6}\x{5D4} \x{5DC}\x{5D0} \x{5DE}\x{5D6}\x{5D9}\x{5E7} \x{5DC}\x{5D9}\" is in Hebrew"
LayoutSVGText {text} at (129.30,171) size 221.39x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (129.30,171) size 221.39x11.39
LayoutSVGText {text} at (129.30,171) size 222x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (129.30,171) size 222x11.39
chunk 1 (middle anchor) text run 1 at (129.30,180.00) startOffset 0 endOffset 56 width 221.40 RTL override: "Text \"\x{5D0}\x{5E0}\x{5D9} \x{5D9}\x{5DB}\x{5D5}\x{5DC} \x{5DC}\x{5D0}\x{5DB}\x{5D5}\x{5DC} \x{5D6}\x{5DB}\x{5D5}\x{5DB}\x{5D9}\x{5EA} \x{5D5}\x{5D6}\x{5D4} \x{5DC}\x{5D0} \x{5DE}\x{5D6}\x{5D9}\x{5E7} \x{5DC}\x{5D9}\" is in Hebrew"
LayoutSVGText {text} at (240,211) size 221.39x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (240,211) size 221.39x11.39
LayoutSVGText {text} at (240,211) size 222x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (240,211) size 222x11.39
chunk 1 (end anchor) text run 1 at (240.00,220.00) startOffset 0 endOffset 56 width 221.40 RTL override: "Text \"\x{5D0}\x{5E0}\x{5D9} \x{5D9}\x{5DB}\x{5D5}\x{5DC} \x{5DC}\x{5D0}\x{5DB}\x{5D5}\x{5DC} \x{5D6}\x{5DB}\x{5D5}\x{5DB}\x{5D9}\x{5EA} \x{5D5}\x{5D6}\x{5D4} \x{5DC}\x{5D0} \x{5DE}\x{5D6}\x{5D9}\x{5E7} \x{5DC}\x{5D9}\" is in Hebrew"
......@@ -12,7 +12,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (273.50,163.19) size 111.59x21.59
chunk 1 (middle anchor) text run 1 at (273.50,180.00) startOffset 0 endOffset 14 width 111.60 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (74.89,163.19) size 310.19x21.59
LayoutSVGInlineText {#text} at (86.30,163.19) size 187.19x21.59
LayoutSVGInlineText {#text} at (85.09,163.19) size 188.39x21.59
chunk 1 (middle anchor) text run 1 at (86.30,180.00) startOffset 0 endOffset 8 width 50.40 RTL: ", \x{627}\x{62E}\x{62A}\x{628}\x{627}\x{631}"
chunk 1 (middle anchor) text run 1 at (136.70,180.00) startOffset 0 endOffset 14 width 136.80: "dirRTL ubEmbed"
LayoutSVGInlineText {#text} at (74.89,163.19) size 11.39x21
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (92.38,133.80) size 275.23x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (282.86,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (283.47,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (283.48,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (92.38,133.80) size 275.23x19.80
LayoutSVGInlineText {#text} at (103.77,133.80) size 179.69x19.80
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (99.38,133.80) size 261.23x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (275.86,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (276.47,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (276.48,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (99.38,133.80) size 261.23x19.80
LayoutSVGInlineText {#text} at (110.77,133.80) size 165.70x19.80
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (86.38,133.80) size 287.23x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (288.84,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (289.47,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (289.47,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (86.38,133.80) size 287.23x19.80
LayoutSVGInlineText {#text} at (97.77,133.80) size 191.69x19.80
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (81.19,133.80) size 297.59x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (294.03,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (294.64,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (294.65,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (81.19,133.80) size 297.59x19.80
LayoutSVGInlineText {#text} at (92.58,133.80) size 202.05x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (88.98,133.80) size 147.13x19.80
chunk 1 (middle anchor) text run 1 at (88.99,150.00) startOffset 0 endOffset 16 width 147.13: "dirRTL ubEmbed \""
LayoutSVGTSpan {tspan} at (88.98,133.80) size 282x19.80
LayoutSVGInlineText {#text} at (236.11,133.80) size 123.50x19.80
LayoutSVGInlineText {#text} at (236.11,133.80) size 123.48x19.80
chunk 1 (middle anchor) text run 1 at (236.12,150.00) startOffset 0 endOffset 3 width 40.00: "W3C"
chunk 1 (middle anchor) text run 1 at (276.12,150.00) startOffset 0 endOffset 14 width 83.50 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} "
LayoutSVGInlineText {#text} at (359.61,133.80) size 11.39x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (88.98,133.80) size 147.13x19.80
chunk 1 (middle anchor) text run 1 at (88.99,150.00) startOffset 0 endOffset 16 width 147.13: "dirRTL ubEmbed \""
LayoutSVGTSpan {tspan} at (88.98,133.80) size 282x19.80
LayoutSVGInlineText {#text} at (236.11,133.80) size 123.50x19.80
LayoutSVGInlineText {#text} at (236.11,133.80) size 123.48x19.80
chunk 1 (middle anchor) text run 1 at (236.12,150.00) startOffset 0 endOffset 3 width 40.00: "W3C"
chunk 1 (middle anchor) text run 1 at (276.12,150.00) startOffset 0 endOffset 14 width 83.50 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} "
LayoutSVGInlineText {#text} at (359.61,133.80) size 11.39x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (95.98,133.80) size 133.13x19.80
chunk 1 (middle anchor) text run 1 at (95.99,150.00) startOffset 0 endOffset 15 width 133.13: "dirRTL ubNone \""
LayoutSVGTSpan {tspan} at (95.98,133.80) size 268x19.80
LayoutSVGInlineText {#text} at (228.50,133.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (229.11,133.80) size 123.50x19.80
chunk 1 (middle anchor) text run 1 at (229.12,150.00) startOffset 0 endOffset 12 width 72.76 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (301.88,150.00) startOffset 0 endOffset 5 width 50.74: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (352.61,133.80) size 11.39x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (95.98,133.80) size 133.13x19.80
chunk 1 (middle anchor) text run 1 at (95.99,150.00) startOffset 0 endOffset 15 width 133.13: "dirRTL ubNone \""
LayoutSVGTSpan {tspan} at (95.98,133.80) size 268x19.80
LayoutSVGInlineText {#text} at (228.50,133.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (229.11,133.80) size 123.50x19.80
chunk 1 (middle anchor) text run 1 at (229.12,150.00) startOffset 0 endOffset 12 width 72.76 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (301.88,150.00) startOffset 0 endOffset 5 width 50.74: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (352.61,133.80) size 11.39x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (82.98,133.80) size 159.11x19.80
chunk 1 (middle anchor) text run 1 at (83.00,150.00) startOffset 0 endOffset 19 width 159.12: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (82.98,133.80) size 294x19.80
LayoutSVGInlineText {#text} at (241.50,133.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (242.11,133.80) size 123.48x19.80
chunk 1 (middle anchor) text run 1 at (242.12,150.00) startOffset 0 endOffset 17 width 123.50 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (365.61,133.80) size 11.39x19.80
chunk 1 (middle anchor) text run 1 at (365.61,150.00) startOffset 0 endOffset 2 width 11.39: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (82.98,133.80) size 159.11x19.80
chunk 1 (middle anchor) text run 1 at (83.00,150.00) startOffset 0 endOffset 19 width 159.12: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (82.98,133.80) size 294x19.80
LayoutSVGInlineText {#text} at (241.50,133.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (242.11,133.80) size 123.48x19.80
chunk 1 (middle anchor) text run 1 at (242.12,150.00) startOffset 0 endOffset 17 width 123.50 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (365.61,133.80) size 11.39x19.80
chunk 1 (middle anchor) text run 1 at (365.61,150.00) startOffset 0 endOffset 2 width 11.39: "\"!"
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (86.38,133.80) size 287.23x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (288.84,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (289.47,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (289.47,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (86.38,133.80) size 287.23x19.80
LayoutSVGInlineText {#text} at (97.77,133.80) size 191.69x19.80
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (100.88,133.80) size 146.11x19.80
chunk 1 (middle anchor) text run 1 at (100.89,150.00) startOffset 0 endOffset 16 width 146.12: "dirLTR ubEmbed \""
LayoutSVGTSpan {tspan} at (89.48,133.80) size 281x19.80
LayoutSVGInlineText {#text} at (246.39,133.80) size 124.09x19.80
LayoutSVGInlineText {#text} at (247,133.80) size 123.48x19.80
chunk 1 (middle anchor) text run 1 at (247.01,150.00) startOffset 0 endOffset 12 width 72.76 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (319.76,150.00) startOffset 0 endOffset 5 width 50.74: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (89.48,133.80) size 11.39x19.80
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.80) size 390x85.20
LayoutSVGText {text} at (91.86,133.80) size 276.25x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (283.36,133.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (283.97,133.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (283.98,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (91.86,133.80) size 276.25x19.80
LayoutSVGInlineText {#text} at (103.25,133.80) size 180.72x19.80
......
......@@ -6,17 +6,17 @@ layer at (0,0) size 800x600
LayoutSVGTSpan {tspan} at (10,33.80) size 126.53x19.80
LayoutSVGInlineText {#text} at (10,33.80) size 126.53x19.80
chunk 1 text run 1 at (10.00,50.00) startOffset 0 endOffset 17 width 126.54 LTR override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGText {text} at (9.38,63.80) size 124.11x19.80 contains 1 chunk(s)
LayoutSVGTSpan {tspan} at (9.38,63.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (9.38,63.80) size 124.11x19.80
LayoutSVGText {text} at (10,63.80) size 123.48x19.80 contains 1 chunk(s)
LayoutSVGTSpan {tspan} at (10,63.80) size 123.48x19.80
LayoutSVGInlineText {#text} at (10,63.80) size 123.48x19.80
chunk 1 text run 1 at (10.00,80.00) startOffset 0 endOffset 12 width 72.76 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 text run 1 at (82.76,80.00) startOffset 0 endOffset 5 width 50.74: "\x{60C} W3C"
LayoutSVGText {text} at (9.38,93.80) size 124.11x19.80 contains 1 chunk(s)
LayoutSVGText {text} at (10,93.80) size 123.48x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (88.48,93.80) size 44.98x19.80
chunk 1 (end anchor) text run 1 at (88.50,110.00) startOffset 0 endOffset 1 width 5.00 RTL: " "
chunk 1 (end anchor) text run 1 at (93.50,110.00) startOffset 0 endOffset 3 width 40.00: "W3C"
LayoutSVGTSpan {tspan} at (9.38,93.80) size 124.11x19.80
LayoutSVGInlineText {#text} at (9.38,93.80) size 79.11x19.80
LayoutSVGTSpan {tspan} at (10,93.80) size 123.48x19.80
LayoutSVGInlineText {#text} at (10,93.80) size 78.48x19.80
chunk 1 (end anchor) text run 1 at (10.00,110.00) startOffset 0 endOffset 13 width 78.50 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C}"
LayoutSVGContainer {g} at (10,33.80) size 126.54x85.39
LayoutSVGRect {rect} at (10,33.80) size 9.47x19.80 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=33.80] [width=9.47] [height=19.80]
......
......@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
chunk 1 (middle anchor) text run 1 at (148.24,150.00) startOffset 0 endOffset 14 width 135.74: "dirRTL ubEmbed"
chunk 1 (middle anchor) text run 1 at (283.98,150.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGText {text} at (91.86,163.80) size 276.25x19.80 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (283.36,163.80) size 84.75x19.80
LayoutSVGInlineText {#text} at (283.97,163.80) size 84.14x19.80
chunk 1 (middle anchor) text run 1 at (283.98,180.00) startOffset 0 endOffset 14 width 84.15 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (91.86,163.80) size 276.25x19.80
LayoutSVGInlineText {#text} at (103.25,163.80) size 180.72x19.80
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (92.30,133.19) size 275.39x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (284.30,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (284.89,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (284.90,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (92.30,133.19) size 275.39x21
LayoutSVGInlineText {#text} at (104.30,133.19) size 180.59x21
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (99.48,133.19) size 261x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (277.09,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (277.69,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (277.70,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (99.48,133.19) size 261x21
LayoutSVGInlineText {#text} at (111.48,133.19) size 166.20x21
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (86.59,133.19) size 286.80x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (290,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (290.59,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (290.60,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (86.59,133.19) size 286.80x21
LayoutSVGInlineText {#text} at (98.59,133.19) size 192x21
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (82.09,133.19) size 295.80x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (294.50,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (295.09,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (295.10,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (82.09,133.19) size 295.80x21
LayoutSVGInlineText {#text} at (94.09,133.19) size 201x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (88.09,133.19) size 148.19x21
chunk 1 (middle anchor) text run 1 at (88.10,150.00) startOffset 0 endOffset 16 width 148.20: "dirRTL ubEmbed \""
LayoutSVGTSpan {tspan} at (88.09,133.19) size 283.80x21
LayoutSVGInlineText {#text} at (236.30,133.19) size 123.59x21
LayoutSVGInlineText {#text} at (236.30,133.19) size 123.58x21
chunk 1 (middle anchor) text run 1 at (236.30,150.00) startOffset 0 endOffset 3 width 41.40: "W3C"
chunk 1 (middle anchor) text run 1 at (277.70,150.00) startOffset 0 endOffset 14 width 82.20 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} "
LayoutSVGInlineText {#text} at (359.89,133.19) size 12x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (88.09,133.19) size 148.19x21
chunk 1 (middle anchor) text run 1 at (88.10,150.00) startOffset 0 endOffset 16 width 148.20: "dirRTL ubEmbed \""
LayoutSVGTSpan {tspan} at (88.09,133.19) size 283.80x21
LayoutSVGInlineText {#text} at (236.30,133.19) size 123.59x21
LayoutSVGInlineText {#text} at (236.30,133.19) size 123.58x21
chunk 1 (middle anchor) text run 1 at (236.30,150.00) startOffset 0 endOffset 3 width 41.40: "W3C"
chunk 1 (middle anchor) text run 1 at (277.70,150.00) startOffset 0 endOffset 14 width 82.20 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} "
LayoutSVGInlineText {#text} at (359.89,133.19) size 12x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (95.30,133.19) size 133.80x21
chunk 1 (middle anchor) text run 1 at (95.30,150.00) startOffset 0 endOffset 15 width 133.80: "dirRTL ubNone \""
LayoutSVGTSpan {tspan} at (95.30,133.19) size 269.39x21
LayoutSVGInlineText {#text} at (228.48,133.19) size 124.20x21
LayoutSVGInlineText {#text} at (229.09,133.19) size 123.59x21
chunk 1 (middle anchor) text run 1 at (229.10,150.00) startOffset 0 endOffset 12 width 71.40 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (300.50,150.00) startOffset 0 endOffset 5 width 52.20: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (352.69,133.19) size 12x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (95.30,133.19) size 133.80x21
chunk 1 (middle anchor) text run 1 at (95.30,150.00) startOffset 0 endOffset 15 width 133.80: "dirRTL ubNone \""
LayoutSVGTSpan {tspan} at (95.30,133.19) size 269.39x21
LayoutSVGInlineText {#text} at (228.48,133.19) size 124.20x21
LayoutSVGInlineText {#text} at (229.09,133.19) size 123.59x21
chunk 1 (middle anchor) text run 1 at (229.10,150.00) startOffset 0 endOffset 12 width 71.40 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (300.50,150.00) startOffset 0 endOffset 5 width 52.20: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (352.69,133.19) size 12x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (82.39,133.19) size 159.59x21
chunk 1 (middle anchor) text run 1 at (82.40,150.00) startOffset 0 endOffset 19 width 159.60: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (82.39,133.19) size 295.19x21
LayoutSVGInlineText {#text} at (241.39,133.19) size 124.19x21
LayoutSVGInlineText {#text} at (242,133.19) size 123.59x21
chunk 1 (middle anchor) text run 1 at (242.00,150.00) startOffset 0 endOffset 17 width 123.60 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (365.59,133.19) size 12x21
chunk 1 (middle anchor) text run 1 at (365.60,150.00) startOffset 0 endOffset 2 width 12.00: "\"!"
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (82.39,133.19) size 159.59x21
chunk 1 (middle anchor) text run 1 at (82.40,150.00) startOffset 0 endOffset 19 width 159.60: "dirRTL ubOverride \""
LayoutSVGTSpan {tspan} at (82.39,133.19) size 295.19x21
LayoutSVGInlineText {#text} at (241.39,133.19) size 124.19x21
LayoutSVGInlineText {#text} at (242,133.19) size 123.59x21
chunk 1 (middle anchor) text run 1 at (242.00,150.00) startOffset 0 endOffset 17 width 123.60 RTL override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGInlineText {#text} at (365.59,133.19) size 12x21
chunk 1 (middle anchor) text run 1 at (365.60,150.00) startOffset 0 endOffset 2 width 12.00: "\"!"
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (86.59,133.19) size 286.80x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (290,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (290.59,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (290.60,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (86.59,133.19) size 286.80x21
LayoutSVGInlineText {#text} at (98.59,133.19) size 192x21
......
......@@ -7,7 +7,7 @@ layer at (0,0) size 800x600
LayoutSVGInlineText {#text} at (100.39,133.19) size 147.59x21
chunk 1 (middle anchor) text run 1 at (100.40,150.00) startOffset 0 endOffset 16 width 147.60: "dirLTR ubEmbed \""
LayoutSVGTSpan {tspan} at (88.39,133.19) size 283.19x21
LayoutSVGInlineText {#text} at (247.39,133.19) size 124.19x21
LayoutSVGInlineText {#text} at (247.98,133.19) size 123.59x21
chunk 1 (middle anchor) text run 1 at (248.00,150.00) startOffset 0 endOffset 12 width 71.40 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 (middle anchor) text run 1 at (319.40,150.00) startOffset 0 endOffset 5 width 52.20: "\x{60C} W3C"
LayoutSVGInlineText {#text} at (88.39,133.19) size 12x21
......
......@@ -4,7 +4,7 @@ layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (20,133.19) size 390x85.81
LayoutSVGText {text} at (91.98,133.19) size 276x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (284.59,133.19) size 83.39x21
LayoutSVGInlineText {#text} at (285.19,133.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (285.20,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (91.98,133.19) size 276x21
LayoutSVGInlineText {#text} at (103.98,133.19) size 181.20x21
......
......@@ -6,17 +6,17 @@ layer at (0,0) size 800x600
LayoutSVGTSpan {tspan} at (10,33.19) size 127.19x21
LayoutSVGInlineText {#text} at (10,33.19) size 127.19x21
chunk 1 text run 1 at (10.00,50.00) startOffset 0 endOffset 17 width 127.20 LTR override: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C} W3C"
LayoutSVGText {text} at (9.39,63.19) size 124.19x21 contains 1 chunk(s)
LayoutSVGTSpan {tspan} at (9.39,63.19) size 124.19x21
LayoutSVGInlineText {#text} at (9.39,63.19) size 124.19x21
LayoutSVGText {text} at (10,63.19) size 123.59x21 contains 1 chunk(s)
LayoutSVGTSpan {tspan} at (10,63.19) size 123.59x21
LayoutSVGInlineText {#text} at (10,63.19) size 123.58x21
chunk 1 text run 1 at (10.00,80.00) startOffset 0 endOffset 12 width 71.40 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}"
chunk 1 text run 1 at (81.40,80.00) startOffset 0 endOffset 5 width 52.20: "\x{60C} W3C"
LayoutSVGText {text} at (9.39,93.19) size 124.19x21 contains 1 chunk(s)
LayoutSVGText {text} at (10,93.19) size 123.59x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (87.39,93.19) size 46.19x21
chunk 1 (end anchor) text run 1 at (87.40,110.00) startOffset 0 endOffset 1 width 4.80 RTL: " "
chunk 1 (end anchor) text run 1 at (92.20,110.00) startOffset 0 endOffset 3 width 41.40: "W3C"
LayoutSVGTSpan {tspan} at (9.39,93.19) size 124.19x21
LayoutSVGInlineText {#text} at (9.39,93.19) size 78x21
LayoutSVGTSpan {tspan} at (10,93.19) size 123.59x21
LayoutSVGInlineText {#text} at (10,93.19) size 77.39x21
chunk 1 (end anchor) text run 1 at (10.00,110.00) startOffset 0 endOffset 13 width 77.40 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644}\x{60C}"
LayoutSVGContainer {g} at (10,33.20) size 127.20x86.58
LayoutSVGRect {rect} at (10,33.20) size 9.60x21 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=33.20] [width=9.60] [height=21.00]
......
......@@ -9,7 +9,7 @@ layer at (0,0) size 800x600
chunk 1 (middle anchor) text run 1 at (148.40,150.00) startOffset 0 endOffset 14 width 136.80: "dirRTL ubEmbed"
chunk 1 (middle anchor) text run 1 at (285.20,150.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGText {text} at (91.98,163.19) size 276x21 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (284.59,163.19) size 83.39x21
LayoutSVGInlineText {#text} at (285.19,163.19) size 82.80x21
chunk 1 (middle anchor) text run 1 at (285.20,180.00) startOffset 0 endOffset 14 width 82.80 RTL: "\x{646}\x{634}\x{627}\x{637} \x{627}\x{644}\x{62A}\x{62F}\x{648}\x{64A}\x{644} \""
LayoutSVGTSpan {tspan} at (91.98,163.19) size 276x21
LayoutSVGInlineText {#text} at (103.98,163.19) size 181.20x21
......
......@@ -70,16 +70,18 @@ void TextMetrics::Update(const Font& font,
// x direction
width_ = bbox.Width();
FloatRect glyph_bounds;
double real_width = font.Width(text_run, nullptr, &glyph_bounds);
float dx = 0.0f;
if (align == kCenterTextAlign)
dx = -width_ / 2.0f;
dx = real_width / 2.0f;
else if (align == kRightTextAlign ||
(align == kStartTextAlign && direction == TextDirection::kRtl) ||
(align == kEndTextAlign && direction != TextDirection::kRtl))
dx = -width_;
actual_bounding_box_left_ = -bbox.X() - dx;
actual_bounding_box_right_ = bbox.MaxX() + dx;
dx = real_width;
actual_bounding_box_left_ = -glyph_bounds.X() + dx;
actual_bounding_box_right_ = glyph_bounds.MaxX() - dx;
// y direction
const float ascent = font_metrics.FloatAscent();
......
......@@ -40,6 +40,8 @@ ShapeCache* CachingWordShaper::GetShapeCache() const {
return font_.font_fallback_list_->GetShapeCache(font_.font_description_);
}
// Returns the total advance width of the TextRun run. If glyph_bounds
// is specified it constructs on it the smallest bounding box covering all ink.
float CachingWordShaper::Width(const TextRun& run,
HashSet<const SimpleFontData*>* fallback_fonts,
FloatRect* glyph_bounds) {
......@@ -48,6 +50,11 @@ float CachingWordShaper::Width(const TextRun& run,
CachingWordShapeIterator iterator(GetShapeCache(), run, &font_);
while (iterator.Next(&word_result)) {
if (word_result) {
// For every word_result we need to accumulate its width to adjust the
// glyph_bounds. When the word_result is in RTL we accumulate in the
// opposite direction (negative).
if (run.Rtl())
width -= word_result->Width();
if (glyph_bounds) {
FloatRect adjusted_bounds = word_result->Bounds();
// Translate glyph bounds to the current glyph position which
......@@ -55,12 +62,21 @@ float CachingWordShaper::Width(const TextRun& run,
adjusted_bounds.SetX(adjusted_bounds.X() + width);
glyph_bounds->Unite(adjusted_bounds);
}
width += word_result->Width();
if (!run.Rtl())
width += word_result->Width();
if (fallback_fonts)
word_result->FallbackFonts(fallback_fonts);
}
}
if (run.Rtl()) {
// Finally, convert width back to positive if run is RTL.
width = -width;
if (glyph_bounds) {
glyph_bounds->SetX(glyph_bounds->X() + width);
}
}
return width;
}
......
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