unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5266: Per-host settings
@ 2009-12-24 18:00 Reuben Thomas
  2009-12-25  9:09 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2009-12-24 18:00 UTC (permalink / raw)
  To: bug-emacs

Hi,

I want to set my default face to a different size depending on the
host I'm on. Alternatively, I'd like to set it to a particular pixel
size regardless of the DPI setting (because that's what I'm really
trying to do!).

I can see a couple of ways of doing this:

1. Use X resources.

2. Use /bin/hostname.

In case 1, how do I set the size desired for an Xft font?

In case 2, how do I cope with the following comment I find in my
current customization file:

  ;; 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.

?

I used to set an X resource Xft.dpi to the same value on all hosts,
but that doesn't seem to affect Emacs 23.

-- 
http://rrt.sc3d.org
Matthew 5:37: tri-state logic considered harmful







^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2009-12-24 18:00 bug#5266: Per-host settings Reuben Thomas
@ 2009-12-25  9:09 ` Andreas Schwab
  2009-12-28 20:31   ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2009-12-25  9:09 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 5266

Reuben Thomas <rrt@sc3d.org> writes:

> In case 1, how do I set the size desired for an Xft font?

You can use family:pixelsize=px as font name.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2009-12-25  9:09 ` Andreas Schwab
@ 2009-12-28 20:31   ` Reuben Thomas
       [not found]     ` <4B43570E.9090606@swipnet.se>
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2009-12-28 20:31 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 5266

2009/12/25 Andreas Schwab <schwab@linux-m68k.org>:
> Reuben Thomas <rrt@sc3d.org> writes:
>
>> In case 1, how do I set the size desired for an Xft font?
>
> You can use family:pixelsize=px as font name.

Thanks. How do I make an X resource setting take precedence over a
customization? Currently, I have:

emacs.font: xft:Deja Vu Sans Mono:pixelsize=14

but even after erasing the customization for "default" face, this
seems to have no effect.

It would be easier if I could set a pixel size customization, but as
far as I can see there's no way to do that?

-- 
http://rrt.sc3d.org
Belief marks the line at which our thinking stops (Carse)






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
       [not found]     ` <4B43570E.9090606@swipnet.se>
@ 2010-01-08 23:44       ` Reuben Thomas
  2010-01-09 12:08         ` Jan Djärv
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2010-01-08 23:44 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 5266

2010/1/5 Jan Djärv <jan.h.d@swipnet.se>:
> That is not the right syntax, And the family name is probably wrong also (no
> space in DejaVu).  On my machine:

Thanks; bizarrely, the family name, which as you say was wrong, was
copied from a working setting for urxvt; I guess it must somehow make
allowances for spaces; what you suggested:

> emacs.font: DejaVu Sans Mono:pixelsize=14

seems to work fine.

> But you should really use just Monospace and have fonts.config map it for
> you to DejaVu (which it probably does).

I don't have a fonts.config file. To what does it belong? My Ubuntu
system seems to use fontconfig, and "monospace" seems to be used as
DejaVu Sans Mono's default family, though whether that means the
default monospace font is DejaVu Sans Mono, I don't know; certainly
under GNOME I have configured DejaVu Sans Mono as the default
monospaced font in its font preferences.

>> It would be easier if I could set a pixel size customization, but as
>> far as I can see there's no way to do that?
>
> You have to fiddle the height parameter to get what you want.

But of course that doesn't work, as height is dpi-dependent, which is
where I came in: trying to get a dpi-independent, i.e. pixel-based
setting (happens to work better for me across different machines, as I
can't easily seem to get per-machine settings any other way, given
that my Emacs configuration files are synchronised between my
machines, so that my environment is kept up to date on all of them).

-- 
http://rrt.sc3d.org
Matthew 5:37: tri-state logic considered harmful






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-08 23:44       ` Reuben Thomas
@ 2010-01-09 12:08         ` Jan Djärv
  2010-01-10 17:35           ` James Cloos
  2010-01-10 17:47           ` Reuben Thomas
  0 siblings, 2 replies; 13+ messages in thread
From: Jan Djärv @ 2010-01-09 12:08 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 5266

Reuben Thomas skrev:
> 2010/1/5 Jan Djärv <jan.h.d@swipnet.se>:
>> That is not the right syntax, And the family name is probably wrong also (no
>> space in DejaVu).  On my machine:
> 
> Thanks; bizarrely, the family name, which as you say was wrong, was
> copied from a working setting for urxvt; I guess it must somehow make
> allowances for spaces; what you suggested:
> 
>> emacs.font: DejaVu Sans Mono:pixelsize=14
> 
> seems to work fine.
> 

There actually is a Gnome format and a fontconfig format for font names.  When 
you say :pixelsize=14, Emacs assumes fontconfig.  Maybe Deja Vu is ok in the 
Gnome format.

>> But you should really use just Monospace and have fonts.config map it for
>> you to DejaVu (which it probably does).
> 
> I don't have a fonts.config file. To what does it belong? My Ubuntu
> system seems to use fontconfig, and "monospace" seems to be used as
> DejaVu Sans Mono's default family, though whether that means the
> default monospace font is DejaVu Sans Mono, I don't know; certainly
> under GNOME I have configured DejaVu Sans Mono as the default
> monospaced font in its font preferences.

/etc/fonts/fonts.conf and also files in /etc/fonts/conf.d.  On my system,
/etc/fonts/conf.d/60-latin.conf maps monospace to DejaVu Sans Mono.


	Jan D.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-09 12:08         ` Jan Djärv
@ 2010-01-10 17:35           ` James Cloos
  2010-01-10 18:51             ` Jan Djärv
  2010-01-10 17:47           ` Reuben Thomas
  1 sibling, 1 reply; 13+ messages in thread
From: James Cloos @ 2010-01-10 17:35 UTC (permalink / raw)
  To: 5266; +Cc: Reuben Thomas

>>>>> "Jan" == Jan Djärv <jan.h.d@swipnet.se> writes:

Jan> There actually is a Gnome format and a fontconfig format for font
Jan> names.  When you say :pixelsize=14, Emacs assumes fontconfig.  Maybe
Jan> Deja Vu is ok in the Gnome format.

Fontconfig's algorithm for matching fonts should ignore (most?) spaces.

I just tested:

  :; fc-match 'Deja Vu Serif-14.4'
  DejaVuSerif.ttf: "DejaVu Serif" "Book"

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-09 12:08         ` Jan Djärv
  2010-01-10 17:35           ` James Cloos
@ 2010-01-10 17:47           ` Reuben Thomas
  2010-01-10 18:55             ` Jan Djärv
  1 sibling, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2010-01-10 17:47 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 5266

2010/1/9 Jan Djärv <jan.h.d@swipnet.se>:
> Reuben Thomas skrev:
>>
>> I don't have a fonts.config file. To what does it belong? My Ubuntu
>> system seems to use fontconfig, and "monospace" seems to be used as
>> DejaVu Sans Mono's default family, though whether that means the
>> default monospace font is DejaVu Sans Mono, I don't know; certainly
>> under GNOME I have configured DejaVu Sans Mono as the default
>> monospaced font in its font preferences.
>
> /etc/fonts/fonts.conf and also files in /etc/fonts/conf.d.  On my system,
> /etc/fonts/conf.d/60-latin.conf maps monospace to DejaVu Sans Mono.

Got it, I have that too. Thanks. I think I prefer to ask specifically
for DejaVu Sans Mono, though I guess that if that's true I should just
copy the current 60-latin.conf into ~/.fonts.conf ?

-- 
http://rrt.sc3d.org
tempus sicut sagittus autem fructus sicut banana






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-10 17:35           ` James Cloos
@ 2010-01-10 18:51             ` Jan Djärv
  2012-02-23 20:08               ` Glenn Morris
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Djärv @ 2010-01-10 18:51 UTC (permalink / raw)
  To: James Cloos; +Cc: 5266@debbugs.gnu.org, Reuben Thomas

Sure, but Emacs has its own parser.

    Jan D.

10 jan 2010 kl. 18.35 skrev James Cloos <cloos@jhcloos.com>:

>>>>>> "Jan" == Jan Djärv <jan.h.d@swipnet.se> writes:
>
> Jan> There actually is a Gnome format and a fontconfig format for font
> Jan> names.  When you say :pixelsize=14, Emacs assumes fontconfig.   
> Maybe
> Jan> Deja Vu is ok in the Gnome format.
>
> Fontconfig's algorithm for matching fonts should ignore (most?)  
> spaces.
>
> I just tested:
>
>  :; fc-match 'Deja Vu Serif-14.4'
>  DejaVuSerif.ttf: "DejaVu Serif" "Book"
>
> -JimC
> -- 
> James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-10 17:47           ` Reuben Thomas
@ 2010-01-10 18:55             ` Jan Djärv
  2010-01-10 21:02               ` Reuben Thomas
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Djärv @ 2010-01-10 18:55 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 5266@debbugs.gnu.org



10 jan 2010 kl. 18.47 skrev Reuben Thomas <rrt@sc3d.org>:

> 2010/1/9 Jan Djärv <jan.h.d@swipnet.se>:
>>
>> /etc/fonts/fonts.conf and also files in /etc/fonts/conf.d.  On my  
>> system,
>> /etc/fonts/conf.d/60-latin.conf maps monospace to DejaVu Sans Mono.
>
> Got it, I have that too. Thanks. I think I prefer to ask specifically
> for DejaVu Sans Mono, though I guess that if that's true I should just
> copy the current 60-latin.conf into ~/.fonts.conf ?
>

No need, files in /etc are used. You only need  ~/.fonts.conf if  
additions or changes to them are needed.

     Jan D.







^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-10 18:55             ` Jan Djärv
@ 2010-01-10 21:02               ` Reuben Thomas
  2010-01-10 22:12                 ` Jan Djärv
  0 siblings, 1 reply; 13+ messages in thread
From: Reuben Thomas @ 2010-01-10 21:02 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 5266@debbugs.gnu.org

2010/1/10 Jan Djärv <jan.h.d@swipnet.se>:
>
>
> 10 jan 2010 kl. 18.47 skrev Reuben Thomas <rrt@sc3d.org>:
>
>> 2010/1/9 Jan Djärv <jan.h.d@swipnet.se>:
>>>
>>> /etc/fonts/fonts.conf and also files in /etc/fonts/conf.d.  On my system,
>>> /etc/fonts/conf.d/60-latin.conf maps monospace to DejaVu Sans Mono.
>>
>> Got it, I have that too. Thanks. I think I prefer to ask specifically
>> for DejaVu Sans Mono, though I guess that if that's true I should just
>> copy the current 60-latin.conf into ~/.fonts.conf ?
>>
>
> No need, files in /etc are used. You only need  ~/.fonts.conf if additions
> or changes to them are needed.

My point was rather that I wanted to protect against the default
monotype font changing in the system files. Since I'd rather do this
once and for all rather than once per system, the logical thing to do
seemed to be to copy the current system setting (which maps monospace
to DejaVu Mono Sans) to my home directory's settings (which are
synched between all the machines I use).

-- 
http://rrt.sc3d.org
Matthew 5:37: tri-state logic considered harmful






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-10 21:02               ` Reuben Thomas
@ 2010-01-10 22:12                 ` Jan Djärv
  0 siblings, 0 replies; 13+ messages in thread
From: Jan Djärv @ 2010-01-10 22:12 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 5266@debbugs.gnu.org



Reuben Thomas skrev 2010-01-10 22.02:
> 2010/1/10 Jan Djärv<jan.h.d@swipnet.se>:
>>
>>
>> 10 jan 2010 kl. 18.47 skrev Reuben Thomas<rrt@sc3d.org>:
>>
>>> 2010/1/9 Jan Djärv<jan.h.d@swipnet.se>:
>>>>
>>>> /etc/fonts/fonts.conf and also files in /etc/fonts/conf.d.  On my system,
>>>> /etc/fonts/conf.d/60-latin.conf maps monospace to DejaVu Sans Mono.
>>>
>>> Got it, I have that too. Thanks. I think I prefer to ask specifically
>>> for DejaVu Sans Mono, though I guess that if that's true I should just
>>> copy the current 60-latin.conf into ~/.fonts.conf ?
>>>
>>
>> No need, files in /etc are used. You only need  ~/.fonts.conf if additions
>> or changes to them are needed.
>
> My point was rather that I wanted to protect against the default
> monotype font changing in the system files. Since I'd rather do this
> once and for all rather than once per system, the logical thing to do
> seemed to be to copy the current system setting (which maps monospace
> to DejaVu Mono Sans) to my home directory's settings (which are
> synched between all the machines I use).
>

Ah, ok.  That makes sense.

	Jan D.







^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2010-01-10 18:51             ` Jan Djärv
@ 2012-02-23 20:08               ` Glenn Morris
  2012-02-25  3:12                 ` Chong Yidong
  0 siblings, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2012-02-23 20:08 UTC (permalink / raw)
  To: 5266; +Cc: Reuben Thomas


Is there still an Emacs issue here, and if so could someone summarize
what it is?





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#5266: Per-host settings
  2012-02-23 20:08               ` Glenn Morris
@ 2012-02-25  3:12                 ` Chong Yidong
  0 siblings, 0 replies; 13+ messages in thread
From: Chong Yidong @ 2012-02-25  3:12 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 5266, Reuben Thomas

Glenn Morris <rgm@gnu.org> writes:

> Is there still an Emacs issue here, and if so could someone summarize
> what it is?

No, AFAICT.  Closing the bug.





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-02-25  3:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-24 18:00 bug#5266: Per-host settings Reuben Thomas
2009-12-25  9:09 ` Andreas Schwab
2009-12-28 20:31   ` Reuben Thomas
     [not found]     ` <4B43570E.9090606@swipnet.se>
2010-01-08 23:44       ` Reuben Thomas
2010-01-09 12:08         ` Jan Djärv
2010-01-10 17:35           ` James Cloos
2010-01-10 18:51             ` Jan Djärv
2012-02-23 20:08               ` Glenn Morris
2012-02-25  3:12                 ` Chong Yidong
2010-01-10 17:47           ` Reuben Thomas
2010-01-10 18:55             ` Jan Djärv
2010-01-10 21:02               ` Reuben Thomas
2010-01-10 22:12                 ` Jan Djärv

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).