help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set-face-font and custom-set-font, DejaVu, fonts for hebrew


From: Eli Zaretskii
Subject: Re: set-face-font and custom-set-font, DejaVu, fonts for hebrew
Date: Fri, 24 Jul 2015 21:13:03 +0300

> From: Uwe Brauer <oub@mat.ucm.es>
> Date: Fri, 24 Jul 2015 16:43:27 +0000
> 
> When I set the Deja Vu font via Options-->Save Options
> the following is written into my custom file:
> 
> (custom-set-faces
>  ;; custom-set-faces was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  '(default ((t (:family "DejaVu Sans Mono" :foundry "unknown" :slant
>  normal :weight normal :height 143 :width normal)))))
> 
> Now I want to modify a function, I use to turning on Hebrew writing
> which also switches the font.
> 
> For example I have
> 
> (defun my-turn-bidi-paragraph-direction-on () 
>   "Just start with  to R2L `bidi-paragraph-direction' set
>   and turn the hebrew (qwerty) keyboard on"
>    (interactive)
>   (setq  bidi-paragraph-direction 'right-to-left)
>   (set-face-font 'default "-etl-*-*-*-*-*-*-240-*-*-*-*-ISO8859-8")
>   (setq org-mime-bidi-support t)
>   (set-input-method "hebrew-phonetic-qwerty" t)
>   (message "R2L on and the hebrew qwerty keyboard!"))
> 
> However  I want now to replace the «etl» font by the nicer Deja Vu font, but
> how? I cannot find the DejaVu font via xfontsel. 

Doesn't the following work for you?

  (set-face-font 'default "DejaVu Sans Mono")

It does for me.

IOW, using the XLFD format for specifying a font is only one of the
several alternatives that Emacs supports.  Another is just to specify
the font name.  See the node "Fonts" in the Emacs manual.

Btw, changing the font of the default face is not the recommended
procedure when all you want is to request that font for a certain
script.  For that, define your fontset-default to use DejaVu Sans Mono
only for the Hebrew script.  There are several examples of how to do
that in the "Modifying Fontsets" node of the Emacs manual.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]