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

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

Re: Different fonts per region


From: tomas
Subject: Re: Different fonts per region
Date: Wed, 2 Mar 2016 14:17:31 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Mar 02, 2016 at 11:52:52AM +0100, henry atting wrote:
> Okay, I can change the font per buffer, frame, mode or set another
> default font.
> Is it also possible to set the font per region, say have three different
> regions in a buffer with three different fonts?
> Just to know if it's possible; outside emacs it would be of little avail
> anyway.

Yes. There are basically two mechanisms you can attach attributes to:
"text properties" and "overlays". In both cases one of those properties
is a "face" property, which (among many other things like colours)
determines the font this text is to be displayed with. This face
property is either a name of some previously defined thing or a
list of name-value pairs for each of the properties.

See the relevant part in the Emacs Lisp manual, either in your local
copy or possibly online here[1] [2] [3]

[1] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html#Text-Properties
[2] 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#Special-Properties
[3] https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces.html#Faces

> 
> henry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlbW5+sACgkQBcgs9XrR2kZSLwCfUB8KRemocbW5AXd+4aqKK02O
MlsAniNLB0/xncGe5yRSsyh47SjPswmt
=D3bT
-----END PGP SIGNATURE-----



reply via email to

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