unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Pasting from X clipboard sometimes uses different font
@ 2008-01-29 20:26 Reuben Thomas
  2008-01-29 21:07 ` Reuben Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Reuben Thomas @ 2008-01-29 20:26 UTC (permalink / raw)
  To: Emacs Bugs

For example, with U+2026 HORIZONTAL ELLIPSIS. If I type one in an Emacs 
buffer, I get the character from my normal font:

*font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-*

whereas if I have one on the X clipboard and paste it (e.g. button-2), then 
I get a wider character, but if I go into hexl-mode I can see it's the same 
character code, though annoyingly it's not on the baseline (so there's also 
a bug in whatever font is being used, but I'm not sure which font is being 
used).

-- 
http://rrt.sc3d.org/ | statistics, n.  the lore of large numbers




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

* Re: Pasting from X clipboard sometimes uses different font
  2008-01-29 20:26 Pasting from X clipboard sometimes uses different font Reuben Thomas
@ 2008-01-29 21:07 ` Reuben Thomas
  2008-01-29 21:29   ` Jason Rumney
  0 siblings, 1 reply; 4+ messages in thread
From: Reuben Thomas @ 2008-01-29 21:07 UTC (permalink / raw)
  To: Emacs Bugs

On Tue, 29 Jan 2008, Reuben Thomas wrote:

> For example, with U+2026 HORIZONTAL ELLIPSIS. If I type one in an Emacs 
> buffer, I get the character from my normal font:
>
> *font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-*
>
> whereas if I have one on the X clipboard and paste it (e.g. button-2), then I 
> get a wider character, but if I go into hexl-mode I can see it's the same 
> character code, though annoyingly it's not on the baseline (so there's also a 
> bug in whatever font is being used, but I'm not sure which font is being 
> used).

I looked at that code point in all my fonts, and found the exact character 
diplayed in

-misc-fixed-medium-r-normal-ko-18-120-100-100-c-180-iso10646-1

Is there any reason that font might have been used when I was pasting from 
the clipboard rather than the default face, mentioned above?

In my custom.el I have:

  '(default ((t (:stipple nil :background "black" :foreground "white" 
:inverse-video nil :box nil :strike-through nil :overline nil :underline nil 
:slant normal :weight normal :height 120 :width semi-condensed :family 
"misc-fixed"))))

i.e. the same font as listed from my .Xresources file, in Emacs notation.

-- 
http://rrt.sc3d.org/ | Astrophysics: it's not exactly rocket science




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

* Re: Pasting from X clipboard sometimes uses different font
  2008-01-29 21:07 ` Reuben Thomas
@ 2008-01-29 21:29   ` Jason Rumney
  2008-01-29 21:35     ` Reuben Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Rumney @ 2008-01-29 21:29 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: Emacs Bugs

Reuben Thomas wrote:
>> For example, with U+2026 HORIZONTAL ELLIPSIS. If I type one in an 
>> Emacs buffer, I get the character from my normal font:
>>
>> *font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-*-*
>>
>> whereas if I have one on the X clipboard and paste it (e.g. 
>> button-2), then I get a wider character, but if I go into hexl-mode I 
>> can see it's the same character code, though annoyingly it's not on 
>> the baseline (so there's also a bug in whatever font is being used, 
>> but I'm not sure which font is being used).

Rather than going into hexl-mode, try pressing C-u C-x = on both 
characters and compare the results.
I suspect that one of these is coming from the mule-unicode-0200-3fff 
character set, and the other from some other character set so uses a 
different font.

If you have a better matched iso10646-1 font on your system, you can 
define a fontset that explicitly includes that font for the 
mule-unicode-* charsets. See the section "Defining fontsets" in the 
Emacs manual for more details.






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

* Re: Pasting from X clipboard sometimes uses different font
  2008-01-29 21:29   ` Jason Rumney
@ 2008-01-29 21:35     ` Reuben Thomas
  0 siblings, 0 replies; 4+ messages in thread
From: Reuben Thomas @ 2008-01-29 21:35 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Emacs Bugs

On Tue, 29 Jan 2008, Jason Rumney wrote:

> Rather than going into hexl-mode, try pressing C-u C-x = on both characters 
> and compare the results.

Thanks, this gives me the difference. The one I paste is:

   character: … (53444, #o150304, #xd0c4, U+2026)
     charset: japanese-jisx0208 (JISX0208.1983/1990 Japanese Kanji: ISO-IR-87.)
  code point: #x21 #x44
      syntax: _ 	which means: symbol
    category: j:Japanese |:While filling, we can break a line at this character.
buffer code: #x92 #xA1 #xC4
   file code: #xE2 #x80 #xA6 (encoded by coding system mule-utf-8-unix)
     display: by this font (glyph code)
      -Misc-Fixed-Medium-R-Normal--14-130-75-75-C-140-JISX0208.1983-0 (#x2144)

There are text properties here:
   fontified            t
   rear-nonsticky       t

while the one in the buffer is:

   character: … (342438, #o1234646, #x539a6, U+2026)
     charset: mule-unicode-0100-24ff (Unicode characters of the range U+0100..U+24FF.)
  code point: #x73 #x26
      syntax: _ 	which means: symbol
buffer code: #x9C #xF4 #xF3 #xA6
   file code: #xE2 #x80 #xA6 (encoded by coding system mule-utf-8-unix)
     display: by this font (glyph code)
      -Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO10646-1 (#x2026)

There are text properties here:
   fontified            t

So the two are the same unicode code point, but Emacs is treating them 
differently. Why? Also, why does Emacs think the character I pasted is 
Japanese?

-- 
http://rrt.sc3d.org/
lawyer, n.  one paid to make the inexcusable incomprehensible




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

end of thread, other threads:[~2008-01-29 21:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29 20:26 Pasting from X clipboard sometimes uses different font Reuben Thomas
2008-01-29 21:07 ` Reuben Thomas
2008-01-29 21:29   ` Jason Rumney
2008-01-29 21:35     ` Reuben Thomas

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