emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cursors: Is superimposing the same glyph a feature?


From: Keith David Bershatsky
Subject: Re: Cursors: Is superimposing the same glyph a feature?
Date: Fri, 15 Feb 2019 23:34:35 -0800

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 <address@hidden>
> To: Keith David Bershatsky <address@hidden>
> CC: address@hidden
> Subject: Re: Cursors:  Is superimposing the same glyph a feature?
> 
> > Date: Fri, 15 Feb 2019 08:27:32 -0800
> > From: Keith David Bershatsky <address@hidden>
> >
> > 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 via email to

[Prev in Thread] Current Thread [Next in Thread]