User: aidan
Date: 05/03/01 14:14:03
Modified: xemacs/lisp Tag: sjt-xft ChangeLog font.el fontconfig.el
Log:
font.el cleanup xft-* -> fc-*, add :regular weight to fontconfig.el
General cleanup of references to functions Eric has deleted
and renamed in the C core.
font.el: xft-xlfd-font-name-p -> xlfd-font-name-p
font.el: xft-pattern-* -> fc-pattern-*, return the created font.
font.el: xft* -> fc*
fontconfig.el: Add information on the "regular" font weight, taken from
fontconfig.h, which is the weight my local system returns by
default.
Revision Changes Path
No revision
No revision
1.599.2.4 +20 -0 XEmacs/xemacs/lisp/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.599.2.3
retrieving revision 1.599.2.4
diff -u -r1.599.2.3 -r1.599.2.4
--- ChangeLog 2005/02/22 10:17:27 1.599.2.3
+++ ChangeLog 2005/03/01 13:14:00 1.599.2.4
@@ -1,3 +1,23 @@
+2005-03-01 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ General cleanup of references to functions Eric has deleted
+ and renamed in the C core.
+ * font.el (x-font-create-object):
+ xft-xlfd-font-name-p -> xlfd-font-name-p
+ * font.el (x-font-create-object-xft):
+ xft-pattern-* -> fc-pattern-*, return the created font.
+ * font.el (x-font-create-name-xft):
+ xft* -> fc*
+ * fontconfig.el (fc-font-name-weight-regular): New.
+ * fontconfig.el (fc-font-name-weight-mapping):
+ * fontconfig.el (fc-font-name-weight-mapping-string):
+ * fontconfig.el (fc-font-name-weight-mapping-string-reverse):
+ * fontconfig.el (fc-font-name-weight-mapping-reverse):
+ * fontconfig.el (fc-font-weight-translate-from-symbol):
+ Add information on the "regular" font weight, taken from
+ fontconfig.h, which is the weight my local system returns by
+ default.
+
2005-02-21 Stephen J. Turnbull <stephen(a)xemacs.org>
* about.el (about-xemacs):
1.15.2.2 +13 -20 XEmacs/xemacs/lisp/font.el
Index: font.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/font.el,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -u -r1.15.2.1 -r1.15.2.2
--- font.el 2004/11/25 12:44:00 1.15.2.1
+++ font.el 2005/03/01 13:14:01 1.15.2.2
@@ -548,7 +548,7 @@
(defun x-font-create-object (fontname &optional device)
"Return a font descriptor object for FONTNAME, appropriate for X devices."
(if (featurep 'xft-fonts)
- (if (xft-xlfd-font-name-p fontname)
+ (if (xlfd-font-name-p fontname)
(x-font-create-object-core fontname device)
(x-font-create-object-xft fontname device))
(x-font-create-object-core fontname device)))
@@ -556,25 +556,20 @@
(defun x-font-create-object-xft (fontname &optional device)
(let* ((name fontname)
(device (or device (default-x-device)))
- (pattern (xft-font-real-pattern name device))
+ (pattern (fc-font-real-pattern name device))
(font-obj (make-font))
- (family (xft-pattern-get-family pattern 0))
- (size (xft-pattern-get-size pattern 0))
- (weight (xft-pattern-get-weight pattern 0))
- (enconding (xft-pattern-get-encoding pattern 0)))
+ (family (fc-pattern-get-family pattern 0))
+ (size (fc-pattern-get-size pattern 0))
+ (weight (fc-pattern-get-weight pattern 0)))
(set-font-family font-obj
- (and (not (equal family 'x-xft-result-no-match))
+ (and (not (equal family 'fc-result-no-match))
family))
(set-font-size font-obj
- (and (not (equal size 'x-xft-result-no-match))
+ (and (not (equal size 'fc-result-no-match))
size))
(set-font-weight font-obj
- (and (not (equal weight 'x-xft-result-no-match))
- (xft-font-weight-translate-from-constant weight)))
-; does not fit into Xft2
-; (set-font-encoding font-obj
-; (and (not (equal enconding 'x-xft-result-no-match))
-; enconding))
+ (and (not (equal weight 'fc-result-no-match))
+ (fc-font-weight-translate-from-constant weight)))
font-obj))
(defun x-font-create-object-core (fontname &optional device)
@@ -685,14 +680,12 @@
(x-font-create-name-core fontobj device)))
(defun x-font-create-name-xft (fontobj &optional device)
- (let* ((pattern (make-xft-pattern)))
+ (let* ((pattern (make-fc-pattern)))
(if (font-family fontobj)
- (xft-pattern-add pattern xft-font-name-property-family
- (font-family fontobj)))
+ (fc-pattern-add-family pattern (font-family fontobj)))
(if (font-size fontobj)
- (xft-pattern-add pattern xft-font-name-property-size
- (font-size fontobj)))
- (xft-name-unparse pattern)))
+ (fc-pattern-add-size pattern (font-size fontobj)))
+ (fc-name-unparse pattern)))
(defun x-font-create-name-core (fontobj &optional device)
"Return a font name constructed from FONTOBJ, appropriate for X devices."
1.1.2.3 +7 -2 XEmacs/xemacs/lisp/Attic/fontconfig.el
Index: fontconfig.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/Attic/fontconfig.el,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- fontconfig.el 2005/02/04 16:06:00 1.1.2.2
+++ fontconfig.el 2005/03/01 13:14:01 1.1.2.3
@@ -207,6 +207,7 @@
(if pair (cdr pair))))
(defconst fc-font-name-weight-light 0)
+(defconst fc-font-name-weight-regular 80)
(defconst fc-font-name-weight-medium 100)
(defconst fc-font-name-weight-demibold 180)
(defconst fc-font-name-weight-bold 200)
@@ -214,6 +215,7 @@
(defconst fc-font-name-weight-mapping
`((,fc-font-name-weight-light . :light)
+ (,fc-font-name-weight-regular . :regular)
(,fc-font-name-weight-medium . :medium)
(,fc-font-name-weight-demibold . :demibold)
(,fc-font-name-weight-bold . :bold)
@@ -221,6 +223,7 @@
(defconst fc-font-name-weight-mapping-string
`((,fc-font-name-weight-light . "Light")
+ (,fc-font-name-weight-regular . "Regular")
(,fc-font-name-weight-medium . "Medium")
(,fc-font-name-weight-demibold . "Demibold")
(,fc-font-name-weight-bold . "Bold")
@@ -228,6 +231,7 @@
(defconst fc-font-name-weight-mapping-string-reverse
`(("Light" . ,fc-font-name-weight-light)
+ ("Regular" . ,fc-font-name-weight-regular)
("Medium" . ,fc-font-name-weight-medium)
("Demibold" . ,fc-font-name-weight-demibold)
("Bold" . ,fc-font-name-weight-bold)
@@ -235,6 +239,7 @@
(defconst fc-font-name-weight-mapping-reverse
`((:light . ,fc-font-name-weight-light)
+ (:regular . ,fc-font-name-weight-regular)
(:medium . ,fc-font-name-weight-medium)
(:demibold . ,fc-font-name-weight-demibold)
(:bold . ,fc-font-name-weight-bold)
@@ -246,8 +251,8 @@
(if pair (cdr pair))))
(defun fc-font-weight-translate-from-symbol (symbol)
- "Translate SYMBOL (`:light', `:medium', `:demibold', `:bold' or
-`:black') to the corresponding Xft font weight constant."
+ "Translate SYMBOL (`:light', `:regular', `:medium',
`:demibold',
+`:bold' or `:black') to the corresponding Xft font weight constant."
(let ((pair (assoc symbol fc-font-name-weight-mapping-reverse)))
(if pair (cdr pair))))