unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Accumulated fontset definition tweaks for testing
@ 2008-05-16  4:19 sand
  2008-05-16  7:50 ` Kenichi Handa
  0 siblings, 1 reply; 3+ messages in thread
From: sand @ 2008-05-16  4:19 UTC (permalink / raw)
  To: emacs-devel

Below is the complete set of fontset changes that my system needed to
display the HELLO file and Markus Kuhn's "UTF-8-demo.txt" file.  There
are various problems with the fontset definitions that we can fix in
Emacs Lisp.

  1. The "symbol" and "phonetic" scripts don't have any representative
  characters defined, and they don't have any fontset defined.

  2. The Latin script doesn't have representative characters over
  7-bits.  This means the Xft backend doesn't have any constraint that
  would reject ISO8859-1 fonts.  Emacs appears to have special support
  for real ISO8859-1 characters, so the new definition should not
  break anything.

  3. The Armenian script has representative characters, but no fontset
  defined.

  4. The Thai fontset definition assumes that you have OpenType set
  up.  It needs a fallback in case you don't.

  5. The Hangul fontset definition assumes that you have a language
  definition in your Hangul font.  It needs a fallback in case you
  don't.

Note that for some people, the "symbol", "phonetic" and Latin scripts
may display just fine.  The problem is that Emacs is not rejecting
ISO8859-1 fonts---but if your installation happens to pick a
ISO10646-1 font with coverage first then you won't see any weirdness.
For example, my work machine had trouble displaying the scripts while
my home machine did not.

It may be that the Thai and Hangul definitions are the tip of the
iceberg.  I suspect that *every* ISO10646-1 fontset definition that
uses :otf or :language needs a fallback definition that uses :script.

If your HELLO file shows weird fonts being picked (such as a
double-width Chinese font for U+2018 LEFT SINGLE QUOTATION MARK) or
"missing font" boxes, can you please try putting the below code into
your .emacs file to see if it fixes the problem?  These were sufficent
to get my work machine displaying every HELLO and "UTF-8-demo.txt"
glyphs for every font that I had installed.

This code can be applied to CVS HEAD before or after the font-backend
merge.

Derek

--
Derek Upham
sand@blarg.net

------------------------------ cut here ------------------------------

;; The eval-after-load here is a hack for testing.  These should
;; really be changes in "fontset.el".
;;
;; Some of the fontset definitions have 'prepend for testing.  When
;; added to "fontset.el" they should go into some appropriate
;; location in the current lists.

(eval-after-load "fontset"
  '(progn

;; Representative characters for Latin need to include the
;; various extension blocks.  This should replace the existing
;; definition.
(setq script-representative-chars
      (cons '(latin ?A ?Z ?a ?z #x00C0 #x0100 #x0180 #x1e00)
            script-representative-chars))

;; Representative characters for symbols were not defined.
(setq script-representative-chars
      (cons '(symbol #x201C #x2200 #x2500)
            script-representative-chars))

;; Representative characters for phonetics were not defined.
(setq script-representative-chars
      (cons '(phonetic #x0250 #x0283)
            script-representative-chars))

;; 'latin script needs a declaration that incorporates the Latin
;; representative characters.  None of the current ones do.
(set-fontset-font "fontset-default" 'latin
 (font-spec :registry "iso10646-1" :script 'latin) nil 'prepend)

;; No 'symbol script declaration exists.  Create one using the new
;; representative characters.
(set-fontset-font "fontset-default" 'symbol
 (font-spec :registry "iso10646-1" :script 'symbol))

;; No 'phonetic declaration exists.  Create one using the new
;; representative characters.  (Note that there is an 'ipa
;; declaration, but 'ipa doesn't exist as a real script.)
(set-fontset-font "fontset-default" 'phonetic
 (font-spec :registry "iso10646-1" :script 'phonetic))

;; No fontset was defined for Armenian.
(set-fontset-font "fontset-default" 'armenian
 (font-spec :registry "iso10646-1" :script 'armenian))

;; The Thai fontset definition assumes that you have OpenType
;; definitions set up properly.  We need an explicit :script
;; declaration as a backup.  I think this should go after the :otf
;; declaration, but I'm doing it as a 'prepend here.  (Perhaps
;; FreeSerif Thai fonts comply with OpenType, but Misc-Fixed
;; ones don't.)
(set-fontset-font "fontset-default" 'thai
 (font-spec :registry "iso10646-1" :script 'thai) nil 'prepend)

;; 'hangul script has a :language restriction for iso10646-1, but also
;; needs :script restriction as alternative.
(set-fontset-font "fontset-default" 'hangul
  (font-spec :registry "iso10646-1" :script 'hangul) nil 'prepend)

))




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

* Re: Accumulated fontset definition tweaks for testing
  2008-05-16  4:19 Accumulated fontset definition tweaks for testing sand
@ 2008-05-16  7:50 ` Kenichi Handa
  2008-05-18  5:04   ` sand
  0 siblings, 1 reply; 3+ messages in thread
From: Kenichi Handa @ 2008-05-16  7:50 UTC (permalink / raw)
  To: sand; +Cc: emacs-devel

In article <18477.2875.876651.446827@priss.frightenedpiglet.com>, sand@blarg.net writes:

> Below is the complete set of fontset changes that my system needed to
> display the HELLO file and Markus Kuhn's "UTF-8-demo.txt" file.  There
> are various problems with the fontset definitions that we can fix in
> Emacs Lisp.

>   1. The "symbol" and "phonetic" scripts don't have any representative
>   characters defined, and they don't have any fontset defined.

>   2. The Latin script doesn't have representative characters over
>   7-bits.  This means the Xft backend doesn't have any constraint that
>   would reject ISO8859-1 fonts.  Emacs appears to have special support
>   for real ISO8859-1 characters, so the new definition should not
>   break anything.

>   3. The Armenian script has representative characters, but no fontset
>   defined.

>   4. The Thai fontset definition assumes that you have OpenType set
>   up.  It needs a fallback in case you don't.

>   5. The Hangul fontset definition assumes that you have a language
>   definition in your Hangul font.  It needs a fallback in case you
>   don't.

Thank you for them.  I'm going reflect 1 to 3 in fontset.el.
I think 4 and 5 is not necessary if we implement
registry-representative-chars as I wrote in the previous
mail.

---
Kenichi Handa
handa@ni.aist.go.jp




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

* Re: Accumulated fontset definition tweaks for testing
  2008-05-16  7:50 ` Kenichi Handa
@ 2008-05-18  5:04   ` sand
  0 siblings, 0 replies; 3+ messages in thread
From: sand @ 2008-05-18  5:04 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: sand, emacs-devel

Kenichi Handa writes:
> Thank you for them.  I'm going reflect 1 to 3 in fontset.el.
> I think 4 and 5 is not necessary if we implement
> registry-representative-chars as I wrote in the previous
> mail.

I enabled simultaneous X and Xft backends using

  Emacs.FontBackend: xft,x

and some of the non-Unicode characters showed display problems that
didn't appear in an Xft-only configuration.  They were falling back to
other fonts even though my "normal" Neep Alt font had glyphs for them.
I was able to fix the problems with some additional fontset
definitions.

  ;; Needed to keep the non-Unicode Esperanto HELLO text from displaying
  ;; as Palladino.
  (set-fontset-font "fontset-default" 'latin
    (font-spec :registry "iso8859-3" :script 'latin) nil 'prepend)

  ;; Needed to keep the non-Unicode Russian HELLO text from displaying
  ;; as Palladino.
  (set-fontset-font "fontset-default" 'cyrillic
    (font-spec :registry "iso8859-5" :script 'cyrillic) nil 'prepend)

  ;; Needed to keep the non-Unicode Vietnamese HELLO text from displaying
  ;; in the Chinese font Ar Pl Zenkai Uni.
  (set-fontset-font "fontset-default" 'latin
    (font-spec :registry "viscii1.1-1" :script 'latin) nil 'prepend)

  ;; Needed to keep certain non-Unicode Greek HELLO text characters
  ;; from displaying in the Japanese font Sazanami Mincho (and showing
  ;; up blank on the screen).
  (set-fontset-font "fontset-default" 'greek
    (font-spec :registry "iso8859-7" :script 'greek) nil 'prepend)

Does the order in which the drivers are specified in the resource have
any effect on the behavior of Emacs?  I wasn't able to see any
difference between "x,xft" and "xft,x".

Derek

-- 
Derek Upham
sand@blarg.net




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

end of thread, other threads:[~2008-05-18  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16  4:19 Accumulated fontset definition tweaks for testing sand
2008-05-16  7:50 ` Kenichi Handa
2008-05-18  5:04   ` sand

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