Subject: bug#20872: 24.5; add-face-text-property doesn't work for :height

From: Wolfgang Jenkner <[email-masked]>
Date: Mon, 22 Jun 2015 17:31:11 +0200

On Mon, Jun 22 2015, Oleh Krehel wrote:

> But this doesn't work:
>
>     (add-face-text-property 0 (length asdf) '(:height 1.0) nil asdf)
>
> While the text properties will change, when inserting `asdf' into a
> `fundamental-mode' buffer, it will still have the height 1.2. How can I
> set the height to 1.0, while preserving the face?

A float as value of the :height attribute works as a scaling factor, see
`set-face-attribute'.  So, IIUC, the following would work

(add-face-text-property 0 (length asdf) `(:height ,(/ 1 1.2)) nil asdf)