all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Cursors:  Is superimposing the same glyph a feature?
Date: Fri, 15 Feb 2019 23:34:35 -0800	[thread overview]
Message-ID: <m2r2c8kwz8.wl%esq@lawlist.com> (raw)

Thank you, Eli, for reading and responding to this particular thread.

Here is a link to a screenshot depicting a somewhat bold appearance of the letter "A" on Emacs 26.1 for OSX without any modifications to the source code -- the build was downloaded from https://emacsformacosx.com/.  HBAR_CURSOR and BAR_CURSOR have the same result.

https://www.lawlist.com/images/hbar_double_imprint.png

Here are my minimal settings in the .emacs file, and then I blew-up the size of the font to get a better screenshot:

(blink-cursor-mode -1)

(setq default-frame-alist (list '(cursor-type . (hbar . 1))
                                '(background-color . "black")
                                '(foreground-color . "white")))

You may need to blow-up the image and break-out the micrometer to discern that the letter "A" with the HBAR_CURSOR is somewhat wider, with more jagged edges, and the middle triangle is somewhat smaller (because the walls of the letter "A" are thicker).  This phenomenon is more easily noticed with the naked eye when holding down the left/right arrow key (repeating) and watching the character at point become bold, and then the bold is removed when moving on to the next character at point.

From what I have been able to discern, drawing a cursor inhibits/prevents ns_maybe_dumpglyphs_background from erasing the glyph area (i.e., no erasing rectangle is drawn), and drawing a cursor also inhibits/prevents font->driver->draw (within ns_draw_glyph_string) from drawing the glyph "with the background".  The result is a double-imprint over an existing glyph creating a somewhat bold appearance.

The reason this question is being asked (i.e., whether this is a feature or simply an oversight) is because I would like to redraw the fake cursors when they get erased due to a left_overwritten situation as determined by draw_glyphs in xdisp.c.  I can simply draw a fake HBAR/BAR cursor without drawing a new glyph; or, I can follow-up the creation of fake cursor with font->driver->draw and double-imprint the glyph -- by not erasing the glyph area beforehand with a rectangle, and by ensuring that the last argument to font->driver->draw is NIL (i.e., draw the glyph without any background).

I do not see this same behavior on the NT or X11 ports of the GUI version of Emacs.

A little more background information:  I am working on update_window and update_text_area to redraw the fake cursors that get erased when the screen updates by calls to write_glyphs and clear_end_of_line.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

> Date: [02-15-2019 10:31:34] <15 Feb 2019 20:31:34 +0200>
> From: Eli Zaretskii <eliz@gnu.org>
> To: Keith David Bershatsky <esq@lawlist.com>
> CC: emacs-devel@gnu.org
> Subject: Re: Cursors:  Is superimposing the same glyph a feature?
> 
> > Date: Fri, 15 Feb 2019 08:27:32 -0800
> > From: Keith David Bershatsky <esq@lawlist.com>
> >
> > In the case of an HBAR_CURSOR; however, the result is a second imprint of the same glyph -- creating a bold appearance of the glyph with the cursor.  Is the bold appearance "a feature", or is this something that has just been overlooked?
> 
> Where do you see the character at point being bold with hbar cursor?
> I don't see it here.



             reply	other threads:[~2019-02-16  7:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-16  7:34 Keith David Bershatsky [this message]
2019-02-16 10:05 ` Cursors: Is superimposing the same glyph a feature? Eli Zaretskii
2019-02-16 11:00 ` Alan Third
  -- strict thread matches above, loose matches on Subject: below --
2019-03-08  3:33 Keith David Bershatsky
2019-03-09  9:22 ` Alan Third
2019-02-16 16:28 Keith David Bershatsky
2019-02-15 16:27 Keith David Bershatsky
2019-02-15 18:31 ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=m2r2c8kwz8.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.