unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59243: 28.2.50; Larger Fringe Bitmaps
@ 2022-11-13 10:08 Daniel Mendler
  2022-11-13 11:47 ` Eli Zaretskii
  2022-11-13 17:49 ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Mendler @ 2022-11-13 10:08 UTC (permalink / raw)
  To: 59243; +Cc: Dmitry Gutov

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

Dear Emacs maintainers,

on Emacs 28, when using large screens, I find the fringe bitmaps
barely recognizable. I've seen there has been a previous discussion
about using characters for the fringe, such that we get scaling, but
this seems to be a longer term effort.

For now if we want to stick to bitmaps of width 8, we could still do
a bit better by using thicker lines, by using the space more
completely and by increasing the height of the bitmaps slightly.

Please consider the fringe bitmaps I've defined in bigger-fringe.el.
This is a cheap change which nevertheless should increase
accessibility a little bit. I override the bitmaps defined in
fringe.c, flymake.el, diff.el and diff-hl.el. The file
bigger-fringe.el contains the command `fringe-bitmap-test', which
I've used to create a screenshot of the updated fringe bitmaps. I've
attached the screenshot for comparison.

[-- Attachment #2: screenshot.png --]
[-- Type: image/png, Size: 76083 bytes --]

[-- Attachment #3: bigger-fringe.el --]
[-- Type: text/plain, Size: 7281 bytes --]

(package-initialize)
(require 'flymake)
;;(require 'diff-hl)
(require 'diff-mode)

(defun fringe-bitmap-test ()
  (interactive)
  (pop-to-buffer (get-buffer-create "*fringe-bitmap-test*"))
  (erase-buffer)
  (dolist (bitmap fringe-bitmaps)
    (insert (format "%s %s\n%s"
                    (propertize "x" 'display `(left-fringe ,bitmap error))
                    bitmap
                    (propertize "\n" 'face '(:height 1))))))

(define-fringe-bitmap 'empty-line
  [#b00000000
   #b11111111
   #b00000000]
  nil nil '(top t))

(define-fringe-bitmap 'right-curly-arrow
  [#b01111100
   #b01111110
   #b00000011
   #b00000011
   #b00000011
   #b01000011
   #b01100111
   #b01101111
   #b01111110
   #b01111000
   #b01111110
   #b01111111])

(define-fringe-bitmap 'left-curly-arrow
  [#b00111110
   #b01111110
   #b11000000
   #b11000000
   #b11000000
   #b11000010
   #b11100110
   #b11110110
   #b01111110
   #b00011110
   #b01111110
   #b11111110])

(define-fringe-bitmap 'hollow-rectangle
  [#b11111111
   #b11111111
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11111111
   #b11111111])

(define-fringe-bitmap 'vertical-bar
  [#b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000])

(define-fringe-bitmap 'horizontal-bar
  [#b11111111
   #b11111111
   #b11111111]
  nil nil 'bottom)

(define-fringe-bitmap 'filled-rectangle
  [#b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111])

(define-fringe-bitmap 'filled-square
  [#b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111
   #b11111111])

(define-fringe-bitmap 'hollow-square
  [#b11111111
   #b11111111
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11000011
   #b11111111
   #b11111111])

(define-fringe-bitmap 'down-arrow
  [#b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b11011011
   #b11011011
   #b11111111
   #b01111110
   #b00111100
   #b00011000])

(define-fringe-bitmap 'up-arrow
  [#b00011000
   #b00111100
   #b01111110
   #b11111111
   #b11011011
   #b11011011
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000
   #b00011000])

(define-fringe-bitmap 'right-arrow
  [#b01100000
   #b01110000
   #b00111000
   #b00011100
   #b00001110
   #b11111111
   #b11111111
   #b00001110
   #b00011100
   #b00111000
   #b01110000
   #b01100000])

(define-fringe-bitmap 'left-arrow
  [#b00000110
   #b00001110
   #b00011100
   #b00111000
   #b01110000
   #b11111111
   #b11111111
   #b01110000
   #b00111000
   #b00011100
   #b00001110
   #b00000110])

(define-fringe-bitmap 'bottom-right-angle
  [#b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b11111111
   #b11111111
   #b11111110]
  nil nil 'bottom)

(define-fringe-bitmap 'top-right-angle
  [#b11111110
   #b11111111
   #b11111111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111]
  nil nil 'top)

(define-fringe-bitmap 'bottom-left-angle
  [#b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11111111
   #b11111111
   #b01111111]
  nil nil 'top)

(define-fringe-bitmap 'top-left-angle
  [#b01111111
   #b11111111
   #b11111111
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000]
  nil nil 'top)

(define-fringe-bitmap 'left-bracket
  [#b01111111
   #b11111111
   #b11111111
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11100000
   #b11111111
   #b11111111
   #b01111111])

(define-fringe-bitmap 'right-bracket
  [#b11111110
   #b11111111
   #b11111111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b00000111
   #b11111111
   #b11111111
   #b11111110])

(define-fringe-bitmap 'exclamation-mark
  [#b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00111000
   #b00000000
   #b00000000
   #b00111000
   #b00111000
   #b00111000])

(define-fringe-bitmap 'left-triangle
  [#b00000011
   #b00000111
   #b00001111
   #b00011111
   #b00111111
   #b01111111
   #b11111111
   #b11111111
   #b01111111
   #b00111111
   #b00011111
   #b00001111
   #b00000111
   #b00000011])

(define-fringe-bitmap 'right-triangle
  [#b11000000
   #b11100000
   #b11110000
   #b11111000
   #b11111100
   #b11111110
   #b11111111
   #b11111111
   #b11111110
   #b11111100
   #b11111000
   #b11110000
   #b11100000
   #b11000000])

(define-fringe-bitmap 'question-mark
  [#b00111100
   #b01111110
   #b11101111
   #b11100111
   #b11100111
   #b11100111
   #b00000111
   #b00001110
   #b00011100
   #b00011100
   #b00111000
   #b00111000
   #b00000000
   #b00000000
   #b00111000
   #b00111000
   #b00111000])

(with-eval-after-load 'diff-mode
  (define-fringe-bitmap 'diff-fringe-add
    [#b00011000
     #b00011000
     #b00011000
     #b11111111
     #b11111111
     #b00011000
     #b00011000
     #b00011000])

  (define-fringe-bitmap 'diff-fringe-del
    [#b11111111
     #b11111111
     #b11111111])

  (define-fringe-bitmap 'diff-fringe-rep
    [#b00111000
     #b00111000
     #b00111000
     #b00111000
     #b00111000
     #b00111000
     #b00111000
     #b00111000
     #b00000000
     #b00000000
     #b00111000
     #b00111000
     #b00111000]))

(with-eval-after-load 'flymake
  (define-fringe-bitmap 'flymake-double-exclamation-mark
    [#b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b11100111
     #b00000000
     #b00000000
     #b11100111
     #b11100111
     #b11100111]))

(advice-add 'diff-hl-define-bitmaps :after
            (lambda ()
              (define-fringe-bitmap 'diff-hl-bmp-insert
                [#b00011000
                 #b00011000
                 #b00011000
                 #b11111111
                 #b11111111
                 #b00011000
                 #b00011000
                 #b00011000])

              (define-fringe-bitmap 'diff-hl-bmp-delete
                [#b11111111
                 #b11111111
                 #b11111111])

              (define-fringe-bitmap 'diff-hl-bmp-i
                [#b00111000
                 #b00111000
                 #b00111000
                 #b00000000
                 #b00000000
                 #b00111000
                 #b00111000
                 #b00111000
                 #b00111000
                 #b00111000
                 #b00111000
                 #b00111000
                 #b00111000])))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59243: 28.2.50; Larger Fringe Bitmaps
  2022-11-13 10:08 bug#59243: 28.2.50; Larger Fringe Bitmaps Daniel Mendler
@ 2022-11-13 11:47 ` Eli Zaretskii
  2022-11-13 13:08   ` Daniel Mendler
  2022-11-13 17:49 ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2022-11-13 11:47 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 59243, dgutov

> Cc: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sun, 13 Nov 2022 11:08:19 +0100
> From: Daniel Mendler <mail@daniel-mendler.de>
> 
> on Emacs 28, when using large screens, I find the fringe bitmaps
> barely recognizable. I've seen there has been a previous discussion
> about using characters for the fringe, such that we get scaling, but
> this seems to be a longer term effort.
> 
> For now if we want to stick to bitmaps of width 8, we could still do
> a bit better by using thicker lines, by using the space more
> completely and by increasing the height of the bitmaps slightly.
> 
> Please consider the fringe bitmaps I've defined in bigger-fringe.el.
> This is a cheap change which nevertheless should increase
> accessibility a little bit. I override the bitmaps defined in
> fringe.c, flymake.el, diff.el and diff-hl.el. The file
> bigger-fringe.el contains the command `fringe-bitmap-test', which
> I've used to create a screenshot of the updated fringe bitmaps. I've
> attached the screenshot for comparison.

Thanks, but is the intent of bigger-fringe.el to have the user load it
manually?  If so, this is sub-optimal: Emacs should switch to larger
fringe bitmaps automatically based on the screen DPI, or perhaps scale
them.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59243: 28.2.50; Larger Fringe Bitmaps
  2022-11-13 11:47 ` Eli Zaretskii
@ 2022-11-13 13:08   ` Daniel Mendler
  2022-11-13 13:48     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Mendler @ 2022-11-13 13:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 59243, dgutov

On 11/13/22 12:47, Eli Zaretskii wrote:
> Thanks, but is the intent of bigger-fringe.el to have the user load it
> manually?  If so, this is sub-optimal: Emacs should switch to larger
> fringe bitmaps automatically based on the screen DPI, or perhaps scale
> them.

My idea here would be to just replace the existing bitmaps with the ones
proposed in bigger-fringe.el. They have the same width, but are a little
bit higher. This way they work better with bigger screens and larger
font sizes while still retaining the thin fringe width. The downside is
that the bitmaps look more compressed horizontally - there is less
breathing space to the text right next to the fringe.

Another alternative could be to provide an alternative larger fringe
bitmap set which is used at larger resolution, if the
left/right-fringe-width is larger than 8. Would you prefer that?

If we indeed want to go the route to auto scale the bitmaps, then I
would go the route via characters or via svg, since scaling the bitmaps
will probably not give great results in contrast to hand-crafted bitmaps.

Daniel





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59243: 28.2.50; Larger Fringe Bitmaps
  2022-11-13 13:08   ` Daniel Mendler
@ 2022-11-13 13:48     ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-11-13 13:48 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 59243, dgutov

> Date: Sun, 13 Nov 2022 14:08:06 +0100
> Cc: 59243@debbugs.gnu.org, dgutov@yandex.ru
> From: Daniel Mendler <mail@daniel-mendler.de>
> 
> On 11/13/22 12:47, Eli Zaretskii wrote:
> > Thanks, but is the intent of bigger-fringe.el to have the user load it
> > manually?  If so, this is sub-optimal: Emacs should switch to larger
> > fringe bitmaps automatically based on the screen DPI, or perhaps scale
> > them.
> 
> My idea here would be to just replace the existing bitmaps with the ones
> proposed in bigger-fringe.el. They have the same width, but are a little
> bit higher.

They seem too large to me, but I wonder what do others think.

In any case, if we accept the bigger defaults, the built-in bitmaps in
fringe.c should be updated.

> Another alternative could be to provide an alternative larger fringe
> bitmap set which is used at larger resolution, if the
> left/right-fringe-width is larger than 8. Would you prefer that?

Yes, but the problem is how to do that automatically.  I think people
have tried in the past but bumped into difficulties.

> If we indeed want to go the route to auto scale the bitmaps, then I
> would go the route via characters or via svg, since scaling the bitmaps
> will probably not give great results in contrast to hand-crafted bitmaps.

Probably.  Indeed, supporting SVG icons on the fringes would be a
useful feature.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59243: 28.2.50; Larger Fringe Bitmaps
  2022-11-13 10:08 bug#59243: 28.2.50; Larger Fringe Bitmaps Daniel Mendler
  2022-11-13 11:47 ` Eli Zaretskii
@ 2022-11-13 17:49 ` Juri Linkov
  2022-11-13 18:17   ` Eli Zaretskii
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2022-11-13 17:49 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 59243, Dmitry Gutov

> Please consider the fringe bitmaps I've defined in bigger-fringe.el.
> This is a cheap change which nevertheless should increase
> accessibility a little bit. I override the bitmaps defined in
> fringe.c, flymake.el, diff.el and diff-hl.el. The file
> bigger-fringe.el contains the command `fringe-bitmap-test', which
> I've used to create a screenshot of the updated fringe bitmaps. I've
> attached the screenshot for comparison.

Oh, I have the opposite problem: the default fringe bitmaps are too big
for my font size.  So I have to use smaller versions:

  (define-fringe-bitmap 'light-down-arrow [32 32 32 32 32 32 168 112 32] nil nil 'bottom)
  (define-fringe-bitmap 'light-up-arrow [32 112 168 32 32 32 32 32 32] nil nil 'top)
  (define-fringe-bitmap 'light-top-left-angle [254 254 128 128 128] nil nil 'top)
  (define-fringe-bitmap 'light-bottom-left-angle [128 128 128 254 254] nil  nil 'bottom)
  (define-fringe-bitmap 'light-left-bracket [254 254 128 128 128 0 0 0 0 128 128 128 254 254] nil nil 'center)
  (define-fringe-bitmap 'light-right-curly-arrow [96 16 8 8 72 80 96 120] nil nil 'bottom)
  (define-fringe-bitmap 'light-left-curly-arrow [8 16 16 16 18 10 6 30] nil nil 'top)
  (define-fringe-bitmap 'light-right-arrow [16 8 252 8 16] nil 11 'center)
  (define-fringe-bitmap 'light-left-arrow [32 64 254 64 32] nil nil 'center)
  (setq-default fringe-indicator-alist
                '((truncation . (light-left-arrow light-right-arrow))
                  (continuation . (light-left-curly-arrow light-right-curly-arrow))
                  (overlay-arrow . right-triangle)
                  (up . light-up-arrow)
                  (down . light-down-arrow)
                  (top . (light-top-left-angle top-right-angle))
                  (bottom . (light-bottom-left-angle bottom-right-angle
                             top-right-angle light-top-left-angle))
                  (top-bottom . (light-left-bracket right-bracket
                                 top-right-angle light-top-left-angle))
                  (empty-line . empty-line)
                  (unknown . question-mark)))

Maybe a new customizable option could allow to select from different sets
of bitmaps with such labels as "Large", "Medium", "Small".





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#59243: 28.2.50; Larger Fringe Bitmaps
  2022-11-13 17:49 ` Juri Linkov
@ 2022-11-13 18:17   ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-11-13 18:17 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 59243, mail, dgutov

> Cc: 59243@debbugs.gnu.org, Dmitry Gutov <dgutov@yandex.ru>
> From: Juri Linkov <juri@linkov.net>
> Date: Sun, 13 Nov 2022 19:49:48 +0200
> 
> Maybe a new customizable option could allow to select from different sets
> of bitmaps with such labels as "Large", "Medium", "Small".

That could be useful, I think.  Assuming that Someone(TM) will come up
with the 2 additional sets of bitmaps.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-13 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-13 10:08 bug#59243: 28.2.50; Larger Fringe Bitmaps Daniel Mendler
2022-11-13 11:47 ` Eli Zaretskii
2022-11-13 13:08   ` Daniel Mendler
2022-11-13 13:48     ` Eli Zaretskii
2022-11-13 17:49 ` Juri Linkov
2022-11-13 18:17   ` Eli Zaretskii

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).