Commit 81af6e72 authored by Andrew Innes's avatar Andrew Innes

(mouse-set-font): Ensure constructed fontset

matches the font selected in the dialog.
parent 27401ec7
...@@ -900,7 +900,7 @@ with the font." ...@@ -900,7 +900,7 @@ with the font."
(if (fboundp 'new-fontset) (if (fboundp 'new-fontset)
(append w32-fixed-font-alist (list (generate-fontset-menu))))))) (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
(if fonts (if fonts
(let (font fontset) (let (font fontset xlfd resolved-font)
(while fonts (while fonts
(condition-case nil (condition-case nil
(progn (progn
...@@ -908,7 +908,17 @@ with the font." ...@@ -908,7 +908,17 @@ with the font."
(if (fontset-name-p font) (if (fontset-name-p font)
(setq fontset font) (setq fontset font)
(condition-case nil (condition-case nil
(setq fontset (create-fontset-from-ascii-font font)) (setq resolved-font (x-resolve-font-name font)
xlfd (x-decompose-font-name resolved-font)
fontset
(create-fontset-from-ascii-font
font resolved-font
(format "%s_%s_%s_%s"
(aref xlfd xlfd-regexp-family-subnum)
(aref xlfd xlfd-regexp-registry-subnum)
(aref xlfd xlfd-regexp-encoding-subnum)
(aref xlfd
xlfd-regexp-pixelsize-subnum))))
(error nil))) (error nil)))
(if fontset (if fontset
(set-default-font fontset) (set-default-font fontset)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment