emacs-devel
[Top][All Lists]
Advanced

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

Re: TUTORIAL.bg and windows-1251


From: Ognyan Kulev
Subject: Re: TUTORIAL.bg and windows-1251
Date: Wed, 14 Jan 2004 13:42:28 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4

Kenichi Handa wrote:
In article <address@hidden>, Ognyan Kulev <address@hidden> writes:

Just copy&paste in both directions works fine. But how can I be sure that the text is encoded with microsoft-cp1251, not with iso10646-1? What program would show the difference?



If (encode-coding-string CYRILLIC_STRING
'ctext-with-extensions) produces a string that contains
"microsoft-cp1251", it means that Emacs is using
microsoft-cp1251 extended seqement in X selection.  And if
copy&paste works fine, that means that the encoding is in a
correct format.

I tested with encode-coding-string and all is OK.

Hmmm strange.  What is the result of this?

(x-resolve-font-name "*-microsoft-cp1251")

We can exchange mails this way for another month, so I decided to dive into the Source ;-) It seems override-fontspec hasn't enough "priority". To see what I mean, take a look at the attached patch. After applying it, microsoft-cp1251 is used in rendering.

Regards,
ogi
Index: fontset.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fontset.c,v
retrieving revision 1.83
diff -u -p -r1.83 fontset.c
--- fontset.c   7 Jan 2004 00:21:53 -0000       1.83
+++ fontset.c   14 Jan 2004 11:36:24 -0000
@@ -254,6 +254,9 @@ lookup_overriding_fontspec (frame, c)
 {
   Lisp_Object tail;
 
+  printf ("lookup_overriding_fontspec %#x\n", c);
+  fflush (stdout);
+
   for (tail = Voverriding_fontspec_alist; CONSP (tail); tail = XCDR (tail))
     {
       Lisp_Object val, target, elt;
@@ -300,11 +303,17 @@ fontset_ref_via_base (fontset, c)
   if (SINGLE_BYTE_CHAR_P (*c))
     return FONTSET_ASCII (fontset);
 
+#if 0
   elt = Qnil;
   if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
     elt = FONTSET_REF (FONTSET_BASE (fontset), *c);
   if (NILP (elt))
     elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c);
+#else
+  elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c);
+  if (NILP (elt) && ! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
+    elt = FONTSET_REF (FONTSET_BASE (fontset), *c);
+#endif
   if (NILP (elt))
     elt = FONTSET_REF (Vdefault_fontset, *c);
   if (NILP (elt))
@@ -592,6 +601,7 @@ fontset_font_pattern (f, id, c)
   Lisp_Object fontset, elt;
   struct font_info *fontp;
 
+#if 0
   elt = Qnil;
   if (fontset_id_valid_p (id))
     {
@@ -607,6 +617,21 @@ fontset_font_pattern (f, id, c)
       XSETFRAME (frame, f);
       elt = lookup_overriding_fontspec (frame, c);
     }
+#else
+  {
+    Lisp_Object frame;
+    
+    XSETFRAME (frame, f);
+    elt = lookup_overriding_fontspec (frame, c);
+  }
+  if (NILP (elt) && fontset_id_valid_p (id))
+    {
+      fontset = FONTSET_FROM_ID (id);
+      xassert (!BASE_FONTSET_P (fontset));
+      fontset = FONTSET_BASE (fontset);
+      elt = FONTSET_REF (fontset, c);
+    }
+#endif
   if (NILP (elt))
     elt = FONTSET_REF (Vdefault_fontset, c);
 

reply via email to

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