unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: JD Smith <jdtsmith@gmail.com>
Cc: 71039@debbugs.gnu.org
Subject: bug#71039: :box :line-width and :underline :position should accept fractional sizes
Date: Sat, 18 May 2024 19:06:29 +0300	[thread overview]
Message-ID: <86le47cdfe.fsf@gnu.org> (raw)
In-Reply-To: <10D600A8-9175-47E7-92DA-B9725AE9D303@gmail.com> (message from JD Smith on Sat, 18 May 2024 10:52:03 -0400)

> From: JD Smith <jdtsmith@gmail.com>
> Date: Sat, 18 May 2024 10:52:03 -0400
> 
> There are, however, two face size attributes which are hard-coded in pixels: :box :linewidth and :underline :
> position.  It would be very convenient if these also accepted fractional floating point values.  E.g. a face
> attribute of:
> 
>  :box (:line-width (0.5 . -0.25)) 
> 
> would indicate a box with half a char width outside padding left & right, and one-quarter char height padding
> above and below.

Are you sure this is a good idea?  What would you like this to do when
two adjacent runs of text are shown using different-size fonts (which
AFAIU is the main use case for this feature)?  We currently force the
thickness and position of the underline to be identical for all the
characters of a stretch of underlined text, even if they are displayed
using different fonts, and we take those values from the first part of
the underlined text's stretch.  This is because having the underline
break or show differently in the middle of an underlined text has ugly
appearance.

OTOH, calculating the thickness and position in pixels from the face
font's dimensions is easy enough if your code needs that.

Given these two facts, I'm not sure supporting float values here will
be worth the effort.

> In addition, :box would be even more powerful, and obviate the use of SVG styling in many situations, if :box :
> line-width optionally accepted a list of four parameters for box dimensions, one for each side:
> 
>  :line-width (left right top bottom)
> 
> naturally as either pixel or floating point fractions.

How is this different from specifying the thickness and the position,
as we have today?





  reply	other threads:[~2024-05-18 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18 14:52 bug#71039: :box :line-width and :underline :position should accept fractional sizes JD Smith
2024-05-18 16:06 ` Eli Zaretskii [this message]
2024-05-19  1:32   ` JD Smith
2024-05-19  6:37     ` Eli Zaretskii
2024-05-19 13:45       ` JD Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le47cdfe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71039@debbugs.gnu.org \
    --cc=jdtsmith@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).