all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Text scale mode and additional fonts
@ 2023-12-30 18:50 Rahguzar
  0 siblings, 0 replies; 3+ 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] 3+ 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; 3+ 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] 3+ messages in thread

end of thread, other threads:[~2023-12-30 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-30 18:50 Text scale mode and additional fonts Rahguzar
  -- strict thread matches above, loose matches on Subject: below --
2023-12-30 11:10 Rahguzar
2023-12-30 17:47 ` Eli Zaretskii

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.