Re: [w3c/selection-api] Add Selection/Range methods based on anchestor element (#102)

Exactly.

The number of new-line characters may be based on the distance between the last character of line block (A) and the first character of the following line block (C) in _em_, divided by line-hight:

```
em1 := Font size of the last character of line block (A) in device pixels
em2 := Font size of the first character of line block (C) in device pixels

lh1 := Line height of the last character of line block (A) in percent / 100
lh2 := Line height of the first character of line block (C) in percent / 100

distance := Distance between base line of the last character of line block (A)
            and base line of first character of line block (C) in device pixels


Number of new-line characters := round(distance / ((em1 / lh1 + em2 / lh2) / 2)))
```
![distance](https://user-images.githubusercontent.com/9283914/53644421-dc186e80-3c36-11e9-9620-1745bdb7083a.png)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/selection-api/issues/102#issuecomment-468683487

Received on Friday, 1 March 2019 14:32:04 UTC