help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Building 21.1 using cygwin


From: Robert Praetorius
Subject: Re: [h-e-w] Building 21.1 using cygwin
Date: Thu, 25 Oct 2001 05:41:59 +1000

> ) seems to work better in every way than the 19.34.5 I run day to day, 
> except for some glitchiness in doing (set-face-attribute ... :font 
...) 
> with font-lock and non-iso8859-1 fonts (I like the raster-terminal 
font 
> for some syntax classes).

     This glitchiness from 21.0.103 persists in 21.1.  I'm almost 
certain that it springs from my lack of understanding of coding systems 
and charsets.  I'm going to post my rather kludgey workaround for 2 
reasons:

    1) it may prompt a comment from someone who instantly sees an
       obviously better and more correct solution

    2) I suspect that other people may bump into the same thing
       and if item 1 doesn't go as predicted, at least they'll have
       a workaround

(Please excuse this code - it's neither optimal nor well organized.  It 
just accreted until I had worked around the problem.  And once I had, 
cleaning it up wasn't my top priority.)

;; I think I might be able to cons up a coding system with
;; cp-make-coding-systems-for-codepage (cp850 for Terminal fonts)
;; but I really don't want a whole new coding system - I just want
;; to use a subset of a font that's compatible with the current
;; coding system.
;; TBD I wish I know how to get the (default?) charset of the current
;; buffer - then I could go to x-font-name-charset-alist and look up
;; string the w32 charset/codepage pair (w32-charset-ansi 1252) in
;; w32-charset-info-alist (I currently have it hardwired)
(defun rudely-wedge-font-into-face (font face)
  "used when we know we're only going to be using a subset
of the font (commonly the 7 bit subset) and really really
want that font even though it has the wrong charset.
Assumes the coding system is iso-latin-1"
  (let* ((xlfd (x-decompose-font-name font))
         (charset-name (concat (aref xlfd 12) "-" (aref xlfd 13)))
         (set-and-page (assoc charset-name w32-charset-info-alist))
         (save-wcia w32-charset-info-alist)
         (save-iedr inhibit-eval-during-redisplay)
         (fudged-font-name (x-compose-font-name
                            (progn (aset xlfd 12 "iso8859")
                                          (aset xlfd 13 "1")
                                          xlfd))))
    (unwind-protect
        (progn
          (push (cons "iso8859-1" (cdr set-and-page))
                w32-charset-info-alist)
          (setq inhibit-eval-during-redisplay nil)
;         (set-face-attribute face nil :family "Terminal")
          (set-face-attribute face nil :font fudged-font-name)
          (message (propertize "%s" 'face face) face)
          (let ((redisplay-dont-pause t))
            (sit-for 0)))
      (setq w32-charset-info-alist save-wcia)
      (setq inhibit-eval-during-redisplay save-iedr))))





reply via email to

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