[Top][All Lists]

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

How to define a font size relative to the default

From: Xiao-Yong Jin
Subject: How to define a font size relative to the default
Date: Fri, 06 Mar 2009 07:48:07 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

Hi, I'm using Emacs checked out from cvs.

`GNU Emacs (x86_64-unknown-linux-gnu, GTK+ Version
2.14.7) of 2009-03-02 on lattice'

I let Emacs use the fontset defined in ~/.Xdefaults as

Emacs.font: Envy Code R-10

Since `Envy Code R' doesn't cover all the code point, I use
set-fontset-font to add an default fallback font with

  (fontset (frame-parameter nil 'font)) 
  nil "DejaVu Sans Mono" nil 'append)

But `DejaVu Sans Mono' turns out to be wider than `Envy Code
R'.  So I decided to make it smaller by adding an explicit
font size as

  (fontset (frame-parameter nil 'font)) 
  nil "DejaVu Sans Mono-9" nil 'append)

And it worked.  Two fonts have the same width.

However, it turns out that Emacs is no longer able to change
the font size of `DejaVu Sans Mono'.  For example, in LaTeX
mode, all instance of letters using `DejaVu Sans Mono' has
the same size, while those using the default `Envy Code R'
change according to the structure; and in text-scale-mode,
letters using `Envy Code R' can change with
text-scale-adjust, but those with `DejaVu Sans Mono' can't.

So, I guess by explicitly specify the font size in
set-fontset-font fixes the font size and there is no other
way to change it.

Can I specify a font size always to be relative to the
default?  Like in face attribute, there is `scale' in
`Height'.  Can I use something similar in set-fontset-font?

I guess usually we want the width of the fonts to be the
same in an editor.  But why does Emacs default to balance
the height of the font?

It also happens in CJK characters where people usually want
to make a character twice as wide as a Latin letter to make
things align correctly.  But as the problem layout above, it
is not an easy task in Emacs.

Is there a solution?

    c/*    __o/*
    <\     * (__
    */\      <

reply via email to

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