unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* font - dpi settings ignored?
@ 2008-06-24  5:41 henry atting
  2008-06-24  6:34 ` henry atting
  0 siblings, 1 reply; 10+ messages in thread
From: henry atting @ 2008-06-24  5:41 UTC (permalink / raw)
  To: emacs-devel

For some time past my dpi settings seem to be ignored. In my
~/.Xdefaults it is set like this:
                
                Xft.dpi:	96

My font is:

                display: by this font (glyph code) 
-unknown-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1 (#x37)

I get an anti-aliased font but 'thin'.

henry





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

* Re: font - dpi settings ignored?
  2008-06-24  5:41 font - dpi settings ignored? henry atting
@ 2008-06-24  6:34 ` henry atting
  2008-06-24 19:05   ` henry atting
  2008-06-25 12:29   ` Kenichi Handa
  0 siblings, 2 replies; 10+ messages in thread
From: henry atting @ 2008-06-24  6:34 UTC (permalink / raw)
  To: emacs-devel

henry atting wrote:

> For some time past my dpi settings seem to be ignored. In my
> ~/.Xdefaults it is set like this:
>                 
>                 Xft.dpi:	96
>
> My font is:
>
>                 display: by this font (glyph code) 
> -unknown-DejaVu Sans
> Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1 
> (#x37)
>
> I get an anti-aliased font but 'thin'.

Er, 'for some time past' means that with older compilations, e.g. one
from april, it still works without problems.

henry





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

* Re: font - dpi settings ignored?
  2008-06-24  6:34 ` henry atting
@ 2008-06-24 19:05   ` henry atting
  2008-06-25 12:29   ` Kenichi Handa
  1 sibling, 0 replies; 10+ messages in thread
From: henry atting @ 2008-06-24 19:05 UTC (permalink / raw)
  To: emacs-devel

Since I ran into problems relating to fonts I would like to know more
about the cause of these problems. Some are solved (infinite-looping,
non anti-aliased fonts), but now I am stuck with that font which
disregards my dpi settings. 
Can somebody, please, give me a hint where to look for further
information.
 
henry





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

* Re: font - dpi settings ignored?
  2008-06-24  6:34 ` henry atting
  2008-06-24 19:05   ` henry atting
@ 2008-06-25 12:29   ` Kenichi Handa
  2008-06-25 14:09     ` henry atting
  1 sibling, 1 reply; 10+ messages in thread
From: Kenichi Handa @ 2008-06-25 12:29 UTC (permalink / raw)
  To: henry atting; +Cc: emacs-devel

In article <87od5r2vfd.fsf@literaturlatenight.de>, henry atting <nospam@literaturlatenight.de> writes:

> henry atting wrote:
> > For some time past my dpi settings seem to be ignored. In my
> > ~/.Xdefaults it is set like this:
> >                 
> >                 Xft.dpi:	96

Could you tell me what does Xft.dpi means?  Is it a way to
tell X applications to assume the specified DPI instead of
what the X server tells by DisplayHeight() and
DisplayHeightMM()?

> > My font is:
> >
> >                 display: by this font (glyph code) 
> > -unknown-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1 
> > (#x37)
> >
> > I get an anti-aliased font but 'thin'.

What do you mean by 'thin'?  Is the pixelsize 15 not
correct?  Or the pixelsize is ok, but glyphs are just thin?

---
Kenichi Handa
handa@ni.aist.go.jp




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

* Re: font - dpi settings ignored?
  2008-06-25 12:29   ` Kenichi Handa
@ 2008-06-25 14:09     ` henry atting
  2008-06-25 16:15       ` James Cloos
  0 siblings, 1 reply; 10+ messages in thread
From: henry atting @ 2008-06-25 14:09 UTC (permalink / raw)
  To: emacs-devel; +Cc: Kenichi Handa

Kenichi Handa wrote:

> In article <87od5r2vfd.fsf@literaturlatenight.de>, 
> henry atting <nospam@literaturlatenight.de> writes:
>
>> henry atting wrote:
>> > For some time past my dpi settings seem to be ignored. In my
>> > ~/.Xdefaults it is set like this:
>> >                 
>> >                 Xft.dpi:	96
>
> Could you tell me what does Xft.dpi means?  Is it a way to
> tell X applications to assume the specified DPI instead of
> what the X server tells by DisplayHeight() and
> DisplayHeightMM()?

In short, yes. 

>> > My font is:
>> >
>> >                 display: by this font (glyph code) 
>> > -unknown-DejaVu Sans Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1 
>> > (#x37)
>> >
>> > I get an anti-aliased font but 'thin'.
>
> What do you mean by 'thin'?  Is the pixelsize 15 not
> correct?  Or the pixelsize is ok, but glyphs are just thin?

The glyphs are just thin. Within an older emacs they still look good.
Please, look at this cutout of a screenshot: 
http://www.literaturlatenight.de/pic.png

henry





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

* Re: font - dpi settings ignored?
  2008-06-25 14:09     ` henry atting
@ 2008-06-25 16:15       ` James Cloos
  2008-06-26 12:37         ` Kenichi Handa
  0 siblings, 1 reply; 10+ messages in thread
From: James Cloos @ 2008-06-25 16:15 UTC (permalink / raw)
  To: emacs-devel; +Cc: Kenichi Handa

>>> >                 Xft.dpi:	96

>> Could you tell me what does Xft.dpi means?

>> Is it a way to tell X applications to assume the specified DPI

> In short, yes. 

More specifically, it tells libXft to use said DPI.  If it exists,
libXft adds that value (a double) to the patterns it sends on to
fontconfig.

If it does not exist, libXft uses DisplayHeight * 25.4 / DisplayHeightMM.

I believe it uses those two (prefering the Xft.dpi value) only if the
application hasn't already specified FC_DPI in the fontconfig pattern.

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




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

* Re: font - dpi settings ignored?
  2008-06-25 16:15       ` James Cloos
@ 2008-06-26 12:37         ` Kenichi Handa
  2008-06-26 15:31           ` James Cloos
  2008-06-26 15:58           ` henry atting
  0 siblings, 2 replies; 10+ messages in thread
From: Kenichi Handa @ 2008-06-26 12:37 UTC (permalink / raw)
  To: James Cloos; +Cc: emacs-devel

In article <m3prq5wkwx.fsf@lugabout.jhcloos.org>, James Cloos <cloos@jhcloos.com> writes:

>>>> >                 Xft.dpi:	96
>>> Could you tell me what does Xft.dpi means?

>>> Is it a way to tell X applications to assume the specified DPI

> > In short, yes. 

> More specifically, it tells libXft to use said DPI.  If it exists,
> libXft adds that value (a double) to the patterns it sends on to
> fontconfig.

> If it does not exist, libXft uses DisplayHeight * 25.4 / DisplayHeightMM.

> I believe it uses those two (prefering the Xft.dpi value) only if the
> application hasn't already specified FC_DPI in the fontconfig pattern.

Thank you for the explanation.  But, then, it seems that the
DPI setting affects only how to convert point-size to
pixel-size.  But, in his screenshot:

  http://www.literaturlatenight.de/pic.png

the rendering is apparently affected.  Are there any
possibility that what is wrong is not Xft.dpi but some other
Xft setting (e.g. RGB)?

---
Kenichi Handa
handa@ni.aist.go.jp




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

* Re: font - dpi settings ignored?
  2008-06-26 12:37         ` Kenichi Handa
@ 2008-06-26 15:31           ` James Cloos
  2008-06-26 15:58           ` henry atting
  1 sibling, 0 replies; 10+ messages in thread
From: James Cloos @ 2008-06-26 15:31 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

>>>>> "Handa" == Kenichi Handa <handa@m17n.org> writes:

Handa> But, in his screenshot:

Handa>   http://www.literaturlatenight.de/pic.png

Handa> the rendering is apparently affected.

In that screenshot, the "thin" text has been grid-fit by the font's
bytecode (ie, freetype's bytecode interpreter is on) with freetype's
grayscale mode.  In the other shot it appears that freetype's autofit
module did the hinting, and RGBA is on.

For libXft apps, turning on the X resource:

Xft.rgba: rgb

(or bgr if one's display has the subpixels in that order) will tell
libXft to set the rgba item in the fontconfig pattern.

That can also be set in fonts.conf with a snippet like:

,----[ /etc/fonts/conf.d/10-sub-pixel-rgb.conf ]
| <?xml version="1.0"?>
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
| <fontconfig>
| <!--  Enable sub-pixel rendering --> 
|   <match target="font">
|     <edit name="rgba" mode="assign"><const>rgb</const></edit>
|   </match>
| </fontconfig>
`----

So, it seems the original poster needs to turn on rgba mode (I use both;
I have 10-sub-pixel-rgb.conf linked from /etc/fonts/conf.available to
/etc/fonts/conf.d and I have Xft.rgba: rgb in my ~/.Xdefaults) and,
since he obviously prefers the autofitter over the bytecode interpreter,
he should use one or the other of:

,----< turn on light autofitting >
| <match target="font" >
|   <edit mode="assign" name="hintstyle" >
|     <const>hintslight</const>
|   </edit>
| </match>
`----

,----< force the use of freetype's autofit module >
| <match target="font">
|   <edit name="autohint" mode="assign"><bool>true</bool></edit>
| </match>
`----

(The former targets freetype's light autofit mode, where only vertical
fitting is done; that ensures that the font's metrics are left unchanged.)

Some background:

Well instructed ttf fonts typically target a stem width of one pixel for
regular and two or three for bold fonts at typical main text font sizes
at typical screen resolution.  The idea is to generate glyphs with
contrast similar to what one sees with bitmap fonts, but with a bit of
anti-aliasing for the curves and diagonals.  Freetype's autofit module,
like OS X's native font rendering, tends to attempt a somewhat softer
appearance which is more consistent with what the fonts look like when
printed.  Fontconfig, if freetype is compiled with support for its ttf
bytecode interpreter, can support both.

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




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

* Re: font - dpi settings ignored?
  2008-06-26 12:37         ` Kenichi Handa
  2008-06-26 15:31           ` James Cloos
@ 2008-06-26 15:58           ` henry atting
  2008-06-26 16:07             ` David Kastrup
  1 sibling, 1 reply; 10+ messages in thread
From: henry atting @ 2008-06-26 15:58 UTC (permalink / raw)
  To: emacs-devel

Kenichi Handa wrote:

> In article <m3prq5wkwx.fsf@lugabout.jhcloos.org>, James Cloos
> <cloos@jhcloos.com> writes:
>
>>>>> >                 Xft.dpi:	96
>>>> Could you tell me what does Xft.dpi means?
>
>>>> Is it a way to tell X applications to assume the specified DPI
>
>> > In short, yes. 
>
>> More specifically, it tells libXft to use said DPI.  If it exists,
>> libXft adds that value (a double) to the patterns it sends on to
>> fontconfig.
>
>> If it does not exist, libXft uses DisplayHeight * 25.4 / DisplayHeightMM.
>
>> I believe it uses those two (prefering the Xft.dpi value) only if the
>> application hasn't already specified FC_DPI in the fontconfig pattern.
>
> Thank you for the explanation.  But, then, it seems that the
> DPI setting affects only how to convert point-size to
> pixel-size.  But, in his screenshot:
>
>   http://www.literaturlatenight.de/pic.png
>
> the rendering is apparently affected.  Are there any
> possibility that what is wrong is not Xft.dpi but some other
> Xft setting (e.g. RGB)?

Since I noticed that the font was rendered correctly on a virtual
debian/lenny (and since I wanted to reinstall my system for some time
past) I installed debian anew. 
I either removed `x-ttcidfont' from the system. 
Now everything works fine.

Thanks,
henry





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

* Re: font - dpi settings ignored?
  2008-06-26 15:58           ` henry atting
@ 2008-06-26 16:07             ` David Kastrup
  0 siblings, 0 replies; 10+ messages in thread
From: David Kastrup @ 2008-06-26 16:07 UTC (permalink / raw)
  To: emacs-devel

henry atting <nospam@literaturlatenight.de> writes:

> Since I noticed that the font was rendered correctly on a virtual
> debian/lenny (and since I wanted to reinstall my system for some time
> past) I installed debian anew.

I just read that as "lesbian/denny".  Now I envy dyslexics their
exciting life.  I need more sleep.

-- 
David Kastrup




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

end of thread, other threads:[~2008-06-26 16:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24  5:41 font - dpi settings ignored? henry atting
2008-06-24  6:34 ` henry atting
2008-06-24 19:05   ` henry atting
2008-06-25 12:29   ` Kenichi Handa
2008-06-25 14:09     ` henry atting
2008-06-25 16:15       ` James Cloos
2008-06-26 12:37         ` Kenichi Handa
2008-06-26 15:31           ` James Cloos
2008-06-26 15:58           ` henry atting
2008-06-26 16:07             ` David Kastrup

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