[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 21:55:29 +0700 |
On Wed, 16 Nov 2022 at 21:48, Eli Zaretskii <eliz@gnu.org> wrote:
> > > Using 'length' to measure the width of text on display is not
> > > reliable, because there are characters of different width. It is
> > > better to use 'string-width' or 'string-pixel-width' instead.
> >
> > The next stumbling point is going to be “make-string does the wrong
> > thing when passed 17.237 as the count”, without an explanation as to
> > what the right thing would be. (I don’t know either.)
>
> Why would sane code call make-string with such an argument?
My train of thought was:
* 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.
- Re: Enclosing text in a box, (continued)
- Re: Enclosing text in a box, Eli Zaretskii, 2022/11/16
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/18
- Re: Enclosing text in a box, Eli Zaretskii, 2022/11/18
- Re: Enclosing text in a box, tomas, 2022/11/18
- Re: Enclosing text in a box, Emanuel Berg, 2022/11/20
- 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 <=
- Re: Enclosing text in a box, Yuri Khan, 2022/11/16
- 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