[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Enclosing text in a box
From: |
Yuri Khan |
Subject: |
Re: Enclosing text in a box |
Date: |
Wed, 16 Nov 2022 22:06:22 +0700 |
On Wed, 16 Nov 2022 at 21:55, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> * OP uses ‘length’ to measure the text, and ‘make-string’ to build a box.
> * You point out that this fails for non-monospace fonts, and suggest
> measuring with ‘string-width’ or ‘string-pixel-width’.
> * OP tries to measure in pixels, realizes one has to divide by the
> width of a box drawing character. The division result turns out
> fractional.
A more-or-less complete solution would probably involve:
* Measuring pixel width of the enclosed text.
* Measuring pixel width of the box drawing character.
* Dividing one by the other, rounding up.
* Appending to the enclosed text a space with a display property
giving it a pixel width that pads the text to an integer number of box
drawing characters.
* (if the enclosed text is editable) Arrange for the above to be
re-done on change.
No, I’m not going to do a prototype.
- Re: Enclosing text in a box, (continued)
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/18
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/16
- Re: Enclosing text in a box, Heime, 2022/11/16
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/16
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/18
- Re: Enclosing text in a box, Yuri Khan, 2022/11/16
- Re: Enclosing text in a box,
Yuri Khan <=
- Re: Enclosing text in a box, tomas, 2022/11/16
- Re: Enclosing text in a box, Heime, 2022/11/16
Re: Enclosing text in a box, Jean Louis, 2022/11/17
RE: [External] : Re: Enclosing text in a box, Drew Adams, 2022/11/18