From 0c43848c272ea5b61a871ee72b7df615081d6dd0 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 21 Apr 2022 15:48:07 +0300 Subject: [PATCH 1/2] Specify baseline behavior in case of non-zero textangle Currently the baseline property is underspecified: the polyline refers to "coordinate system of the line" which is not defined anywhere else in the document. This makes it unclear how baseline should be specified when textangle is non-zero. The interpretation that textangle should be ignored would result in error in the specification because completely vertical text would have slope angle equal to positive or negative infinity which can not be represented by the current grammar. Therefore, textangle should be taken into account. However, it's not clear how it should affect baseline because the specification does not constrain textangle to any specific angle. This issue is fixed by explicitly specifying what coordinate system will be used for the baseline polynomial in all possible values of textangle property. --- 1.2/spec.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/1.2/spec.md b/1.2/spec.md index eccafc4..a580834 100644 --- a/1.2/spec.md +++ b/1.2/spec.md @@ -587,8 +587,25 @@ This property applies primarily to textlines. The baseline is described by a polynomial of order `n` with the coefficients `pn ... p0` with `n = 1` for a linear (i.e. straight) line. -The polynomial is in the coordinate system of the line, with the bottom left of -the bounding box as the origin. +The polynomial is in coordinate system which depends on the `textangle` value +that is effective for the element. The coordinate system is defined as follows: + + * if `textangle` property is not present or has value in ranges `[315, 360]` or + `[0, 45)`, then the origin is the bottom left of the bounding box. The x-axis + and the y-axis are the same as the x-axis and the y-axis of the document image + respectively. + + * if `textangle` property has value in range `[45, 135)` then the origin is the + bottom right of the bounding box. The x-axis is the opposite as the y-axis + of the document image, y-axis is the same as the x-axis of the document image. + + * if `textangle` property has value in range `[135, 225)` then the origin is the + top right of the bounding box. The x-axis and the y-axis are the opposite of + the x-axis and the y-axis of the document image respectively. + + * if `textangle` property has value in range `[225, 315)` then the origin is the + top left of the bounding box. The x-axis is the same as the y-axis + of the document image, y-axis is the opposite of the x-axis of the document image.
From bd774e6e72c6868662a3b937d68fda6bec4164cb Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 21 Apr 2022 15:48:08 +0300 Subject: [PATCH 2/2] Fix typo in textangle definition --- 1.2/spec.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.2/spec.md b/1.2/spec.md index a580834..250fcaa 100644 --- a/1.2/spec.md +++ b/1.2/spec.md @@ -844,7 +844,7 @@ The textangle property {#textangle}
path: include/defs/textangle
-The angle in degrees by which textual content has been rotate relative to the +The angle in degrees by which textual content has been rotated relative to the rest of the page (if not present, the angle is assumed to be zero); rotations are counter-clockwise, so an angle of 90 degrees is vertical text running from bottom to top in Latin script; note that this is different from reading order,