all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [External] : Re: Text scale mode and additional fonts
@ 2024-01-01 13:11 Rahguzar
  2024-02-13  9:02 ` Rahguzar
  0 siblings, 1 reply; 11+ messages in thread
From: Rahguzar @ 2024-01-01 13:11 UTC (permalink / raw)
  To: eliz; +Cc: help-gnu-emacs

Hi Eli,

> Which font-spec did you try to pass?  IOW, please show a recipe that
> fails as above.

I see the error in the echo area of the Emacs frame that pops us when I
execute e.g.

emacs -Q --eval="(add-to-list 'face-font-rescale-alist `(,(font-spec :family \"Mehr Nastaliq Web\") . ,(/ 28.0 24)))"

The name of the family is not important and to me if happens for all names.

If I do `C-h v face-font-rescale-alist RET` the value of
face-font-rescale-alist includes a key for the font-spec but the error
stops loading of the config in normal use.

Thanks,
Rahguzar



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [External] : Re: Text scale mode and additional fonts
@ 2024-02-19 17:11 Rahguzar
  0 siblings, 0 replies; 11+ messages in thread
From: Rahguzar @ 2024-02-19 17:11 UTC (permalink / raw)
  To: eliz; +Cc: help-gnu-emacs

Hi Eli,

> I eventually found some time to look into this.  It turned out this
> was a bug in the Emacs startup code, now fixed in what will eventually
> become Emacs 30.1.

I tested and the error is gone now.

As always, thanks a lot!
Rahguzar



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [External] : Re: Text scale mode and additional fonts
@ 2023-12-31 10:41 Rahguzar
  2024-01-01 12:09 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Rahguzar @ 2023-12-31 10:41 UTC (permalink / raw)
  To: luangruo; +Cc: help-gnu-emacs

Hi Po,

> It's also worth mentioning that face-font-rescale-alist frees you from
> providing a scale factor in every place the font to be scaled is
> specified.

Thank you so much face-font-rescale-alist is exactly what I wanted. But
it seems like there is bug or at least a problem with doc string. It
mentions that FONT-PATTERN can be a font-spec but when I try to pass a
font spec in my config I get an error:

string-match-p: Wrong type argument: stringp, #<font-spec nil nil Mehr\ Nastaliq\ Web nil nil nil nil nil nil nil nil nil nil>

Using the font name for FONT-PATTERN works as expected, so I have used
that.

Thanks again,
Rahguzar



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Text scale mode and additional fonts
@ 2023-12-30 11:10 Rahguzar
  2023-12-30 17:47 ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Rahguzar @ 2023-12-30 11:10 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,
I sometimes write documents with a mix of Urdu and English. For Urdu I
have this in my config:

(setq +bidi-arabic-font (font-spec :family "Mehr Nastaliq Web"))

(set-fontset-font t 'arabic +bidi-arabic-font)

The font can be found here
https://mehrtype.com/product/mehr-nastaliq-web/

This works but Urdu text is too small. I can use `text-scale-increase`
but that also makes the English text bigger. So I tried this snippet
instead:

(setq +bidi-arabic-font (font-spec :family "Mehr Nastaliq Web" :size 28))

(set-fontset-font t 'arabic +bidi-arabic-font)

this makes the initial situation better but now the Urdu text is not
affected by the `text-scale-mode` commands.

To overcome this I have added a hook to `text-scale-mode-hook` to
manually adjust the font size. This improves the situation but feels
wrong since the `text-scale-mode` uses face remapping machinery which is
buffer local but the font sizes are global.

Is there a way to set a different size for my Urdu font that makes it
work seamlessly with `text-scale-mode`?

Thanks,
Rahguzar



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

end of thread, other threads:[~2024-02-19 17:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-01 13:11 [External] : Re: Text scale mode and additional fonts Rahguzar
2024-02-13  9:02 ` Rahguzar
2024-02-13 13:02   ` Eli Zaretskii
2024-02-15 10:07   ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2024-02-19 17:11 Rahguzar
2023-12-31 10:41 Rahguzar
2024-01-01 12:09 ` Eli Zaretskii
2023-12-30 11:10 Rahguzar
2023-12-30 17:47 ` Eli Zaretskii
2023-12-30 18:12   ` [External] : " Drew Adams
2023-12-30 18:54     ` Eli Zaretskii
2023-12-30 21:17       ` Drew Adams
2023-12-31  0:58         ` Po Lu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.