diff options
| author | Eli Zaretskii | 2022-04-28 10:50:50 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2022-04-28 10:50:50 +0300 |
| commit | 76d4e19f8984128d9253673fa91ce5423e9293f1 (patch) | |
| tree | c617ccae45501db6cfcfec2da7d7d4400a9f260b | |
| parent | 9c70045f674b31db7a640d8a59939ce8df7ed37b (diff) | |
| download | emacs-76d4e19f8984128d9253673fa91ce5423e9293f1.tar.gz emacs-76d4e19f8984128d9253673fa91ce5423e9293f1.zip | |
Fix handling of proportional fonts on MS-Windows
* src/xfaces.c (Fx_family_fonts): Consider fonts whose :spacing
value is numeric, but still indicates that they are proportional,
to be proportional.
* lisp/textmodes/artist.el (artist-mode): Fix test for monospaced
fonts.
| -rw-r--r-- | lisp/textmodes/artist.el | 7 | ||||
| -rw-r--r-- | src/xfaces.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index e37b0d988ab..686d5f494c9 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el | |||
| @@ -1371,8 +1371,11 @@ Keymap summary | |||
| 1371 | (t | 1371 | (t |
| 1372 | ;; Turn mode on | 1372 | ;; Turn mode on |
| 1373 | (artist-mode-init) | 1373 | (artist-mode-init) |
| 1374 | (let ((font (face-attribute 'default :font))) | 1374 | (let* ((font (face-attribute 'default :font)) |
| 1375 | (when (and (fontp font) (not (font-get font :spacing))) | 1375 | (spacing-prop (if (fontp font) |
| 1376 | (font-get font :spacing) | ||
| 1377 | t))) | ||
| 1378 | (when (or (null spacing-prop) (eq spacing-prop 0)) | ||
| 1376 | (message "The default font isn't monospaced, so the drawings in this buffer may look odd")))))) | 1379 | (message "The default font isn't monospaced, so the drawings in this buffer may look odd")))))) |
| 1377 | 1380 | ||
| 1378 | ;; Init and exit | 1381 | ;; Init and exit |
diff --git a/src/xfaces.c b/src/xfaces.c index d7f1f4d96e5..c41782f4f38 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -1573,7 +1573,14 @@ the face font sort order. */) | |||
| 1573 | make_fixnum (point), | 1573 | make_fixnum (point), |
| 1574 | FONT_WEIGHT_SYMBOLIC (font), | 1574 | FONT_WEIGHT_SYMBOLIC (font), |
| 1575 | FONT_SLANT_SYMBOLIC (font), | 1575 | FONT_SLANT_SYMBOLIC (font), |
| 1576 | NILP (spacing) || EQ (spacing, Qp) ? Qnil : Qt, | 1576 | (NILP (spacing) |
| 1577 | || EQ (spacing, Qp) | ||
| 1578 | /* If the font was specified in a way | ||
| 1579 | different from XLFD (e.g., on MS-Windows), | ||
| 1580 | we will have a number there, not 'p'. */ | ||
| 1581 | || EQ (spacing, | ||
| 1582 | make_fixnum (FONT_SPACING_PROPORTIONAL))) | ||
| 1583 | ? Qnil : Qt, | ||
| 1577 | Ffont_xlfd_name (font, Qnil), | 1584 | Ffont_xlfd_name (font, Qnil), |
| 1578 | AREF (font, FONT_REGISTRY_INDEX)); | 1585 | AREF (font, FONT_REGISTRY_INDEX)); |
| 1579 | result = Fcons (v, result); | 1586 | result = Fcons (v, result); |