unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Text scale mode and additional fonts
@ 2023-12-30 11:10 Rahguzar
  2023-12-30 17:47 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ 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] 7+ messages in thread
* Re: Text scale mode and additional fonts
@ 2023-12-30 18:50 Rahguzar
  0 siblings, 0 replies; 7+ messages in thread
From: Rahguzar @ 2023-12-30 18:50 UTC (permalink / raw)
  To: eliz; +Cc: help-gnu-emacs

Hi Eli,

> That's because the :size attribute is absolute: 28.  Instead, use a
> relative value, a float such as 1.5, then it should scale with the
> rest of the text.

I tried

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

and it doesn't change the behavior. With it if I use `describe-char` on an
Urdu character, I always see,

ftcrhb:-ITU -Mehr Nastaliq Web-regular-normal-normal-*-37-*-*-*-*-0-iso10646-1 (#x8F)

regardless of the `text-scale-mode-amount`. So a float value changes the
units but not the behavior w.r.t. `text-scale-mode`.

Thanks,
Rahguzar



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

end of thread, other threads:[~2023-12-31  0:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-30 11:10 Text scale mode and additional fonts 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
  -- strict thread matches above, loose matches on Subject: below --
2023-12-30 18:50 Rahguzar

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