all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Font pixel size selection
@ 2008-06-15  6:31 Yuan MEI
  2008-06-15  8:41 ` Yuan MEI
  2008-06-15 11:12 ` James Cloos
  0 siblings, 2 replies; 13+ messages in thread
From: Yuan MEI @ 2008-06-15  6:31 UTC (permalink / raw)
  To: emacs-devel

Hi,

    I have just updated to the cvs HEAD, (last was one month ago).
I set font in ~/.Xdefaults like:
Emacs.Font: Bitstream Vera Sans Mono:pixelsize=14
Using one month ago version it did show 14 pixels font well

However now, with the same setting, the font changes to
-bitstream-Bitstream Vera Sans
Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1

And if I change it to
Emacs.Font: Bitstream Vera Sans Mono-14
The result is even more weird.
-bitstream-Bitstream Vera Sans
Mono-normal-normal-normal-*-17-*-*-*-m-0-iso8859-1 (#x1E)

I can set
Emacs.Font: -*-Bitstream Vera Sans Mono-*-*-*-*-14-*-*-*-*-*-*-*
to force emacs to use 14 pixels font, but I wonder what caused this
behavior and is it desired?

Maybe this problem is also related to my upgration to freetype package
2.3.6 or libXft 2.1.12? on gentoo linux.

Thank you
-- 
Yuan MEI




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

* Re: Font pixel size selection
  2008-06-15  6:31 Font pixel size selection Yuan MEI
@ 2008-06-15  8:41 ` Yuan MEI
  2008-06-15 11:12 ` James Cloos
  1 sibling, 0 replies; 13+ messages in thread
From: Yuan MEI @ 2008-06-15  8:41 UTC (permalink / raw)
  To: emacs-devel

OK, seems the `pixelsize' is interpreted as `point size'.  Should this be fixed?

On 6/15/08, Yuan MEI <yuan.mei.list@gmail.com> wrote:
> Hi,
>
>     I have just updated to the cvs HEAD, (last was one month ago).
>  I set font in ~/.Xdefaults like:
>  Emacs.Font: Bitstream Vera Sans Mono:pixelsize=14
>  Using one month ago version it did show 14 pixels font well
>
>  However now, with the same setting, the font changes to
>  -bitstream-Bitstream Vera Sans
>  Mono-normal-normal-normal-*-15-*-*-*-m-0-iso8859-1
>
>  And if I change it to
>  Emacs.Font: Bitstream Vera Sans Mono-14
>  The result is even more weird.
>  -bitstream-Bitstream Vera Sans
>  Mono-normal-normal-normal-*-17-*-*-*-m-0-iso8859-1 (#x1E)
>
>  I can set
>  Emacs.Font: -*-Bitstream Vera Sans Mono-*-*-*-*-14-*-*-*-*-*-*-*
>  to force emacs to use 14 pixels font, but I wonder what caused this
>  behavior and is it desired?
>
>  Maybe this problem is also related to my upgration to freetype package
>  2.3.6 or libXft 2.1.12? on gentoo linux.
>
>  Thank you
>  --
>
> Yuan MEI
>


-- 
Yuan MEI




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

* Re: Font pixel size selection
  2008-06-15  6:31 Font pixel size selection Yuan MEI
  2008-06-15  8:41 ` Yuan MEI
@ 2008-06-15 11:12 ` James Cloos
  2008-06-15 22:04   ` Yuan MEI
  2008-06-16  1:55   ` Kenichi Handa
  1 sibling, 2 replies; 13+ messages in thread
From: James Cloos @ 2008-06-15 11:12 UTC (permalink / raw)
  To: emacs-devel; +Cc: Yuan MEI

I posted a bug about this (420), but I didn't see it hit any of the lists.

The font parsing code was recently updated to allow GTK-style font names,
and this broke the parsing of fontconfig-style font patterns.

The comment before font_parse_fcname() in src/font.c correctly specifies
what a fontconfig pattern should look like, and a quick read through
suggests that it ought to do the right thing, by presuming the string is
a fontconfig pattern if it matches <name>:<properties list>.

To get around the bug, I used xfd(1x) and xmag(1x) to figure out what
pointsize matched my desired pixelsize, and changed my ~/.Xdefaults to
specify that, for now.

(At 133 dpi, DejaVu Sans Mono:pixelsize=14  ==  DejaVu Sans Mono-7.4;
that will likely be the same for Vera.  At any other dpi, of course,
it will differ.)

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





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

* Re: Font pixel size selection
  2008-06-15 11:12 ` James Cloos
@ 2008-06-15 22:04   ` Yuan MEI
  2008-06-15 22:41     ` James Cloos
  2008-06-16  1:55   ` Kenichi Handa
  1 sibling, 1 reply; 13+ messages in thread
From: Yuan MEI @ 2008-06-15 22:04 UTC (permalink / raw)
  To: James Cloos; +Cc: emacs-devel

I think the only problem here is :pixelsize=14

Fontconfig has the format:

<families>-<point sizes>:<name1>=<values1>:<name2>=<values2>

which indicates the number should be `point size', therefore the
actual on screen pixel size could be calculated as <point size>/72*dpi

However, it should also allow user to specify the pixel size directly
through something like :pixelsize=14

Y. M.

On 6/15/08, James Cloos <cloos@jhcloos.com> wrote:
> I posted a bug about this (420), but I didn't see it hit any of the lists.
>
>  The font parsing code was recently updated to allow GTK-style font names,
>  and this broke the parsing of fontconfig-style font patterns.
>
>  The comment before font_parse_fcname() in src/font.c correctly specifies
>  what a fontconfig pattern should look like, and a quick read through
>  suggests that it ought to do the right thing, by presuming the string is
>  a fontconfig pattern if it matches <name>:<properties list>.
>
>  To get around the bug, I used xfd(1x) and xmag(1x) to figure out what
>  pointsize matched my desired pixelsize, and changed my ~/.Xdefaults to
>  specify that, for now.
>
>  (At 133 dpi, DejaVu Sans Mono:pixelsize=14  ==  DejaVu Sans Mono-7.4;
>  that will likely be the same for Vera.  At any other dpi, of course,
>  it will differ.)
>
>  -JimC
>
> --
>  James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6
>
>


-- 
Yuan MEI




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

* Re: Font pixel size selection
  2008-06-15 22:04   ` Yuan MEI
@ 2008-06-15 22:41     ` James Cloos
  2008-06-16  2:01       ` Chong Yidong
  0 siblings, 1 reply; 13+ messages in thread
From: James Cloos @ 2008-06-15 22:41 UTC (permalink / raw)
  To: Yuan MEI; +Cc: emacs-devel

>>>>> "Yuan" == Yuan MEI <yuan.mei.list@gmail.com> writes:

Yuan> I think the only problem here is :pixelsize=14
Yuan> Fontconfig has the format:

Yuan> <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>

The -<pointsize> part is optional; the comment and the code in font.c
acknowledge that fact.  But it clearly doesn't work.

That said, I don’t see where the current code breaks....

I currently get this for DejaVu Sans Mono:pixelsize=14

-unknown-DejaVu Sans Mono-normal-normal-normal-*-22-*-*-*-m-0-iso8859-1

where I used to get:

-unknown-DejaVu Sans Mono-normal-normal-normal-*-14-*-*-*-m-0-iso8859-1

(both according to C-uC-x=).

(Odd that they show 8859-1, it really ought to be 10646-1.)

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




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

* Re: Font pixel size selection
  2008-06-15 11:12 ` James Cloos
  2008-06-15 22:04   ` Yuan MEI
@ 2008-06-16  1:55   ` Kenichi Handa
  1 sibling, 0 replies; 13+ messages in thread
From: Kenichi Handa @ 2008-06-16  1:55 UTC (permalink / raw)
  To: cyd; +Cc: yuan.mei.list, cloos, emacs-devel

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

> I posted a bug about this (420), but I didn't see it hit any of the lists.
> The font parsing code was recently updated to allow GTK-style font names,
> and this broke the parsing of fontconfig-style font patterns.

> The comment before font_parse_fcname() in src/font.c correctly specifies
> what a fontconfig pattern should look like, and a quick read through
> suggests that it ought to do the right thing, by presuming the string is
> a fontconfig pattern if it matches <name>:<properties list>.

I confirmed the current font_parse_fcname has a bug (though
I have not yet figured out which part of the code is the
culprit).  Chong, could you please fix it?

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




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

* Re: Font pixel size selection
  2008-06-15 22:41     ` James Cloos
@ 2008-06-16  2:01       ` Chong Yidong
  2008-06-16  4:13         ` Kenichi Handa
  2008-06-16  5:18         ` İsmail Dönmez
  0 siblings, 2 replies; 13+ messages in thread
From: Chong Yidong @ 2008-06-16  2:01 UTC (permalink / raw)
  To: James Cloos; +Cc: Yuan MEI, 402-close, emacs-devel

James Cloos <cloos@jhcloos.com> writes:

> Yuan> I think the only problem here is :pixelsize=14
> Yuan> Fontconfig has the format:
>
> Yuan> <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>
>
> The -<pointsize> part is optional; the comment and the code in font.c
> acknowledge that fact.  But it clearly doesn't work.

I've checked in a fix.  I believe this should work correctly now.

Thanks.




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

* Re: Font pixel size selection
  2008-06-16  2:01       ` Chong Yidong
@ 2008-06-16  4:13         ` Kenichi Handa
  2008-06-16 14:36           ` Chong Yidong
  2008-06-16  5:18         ` İsmail Dönmez
  1 sibling, 1 reply; 13+ messages in thread
From: Kenichi Handa @ 2008-06-16  4:13 UTC (permalink / raw)
  To: Chong Yidong; +Cc: yuan.mei.list, 402-close, cloos, emacs-devel

In article <8763sat9xb.fsf@stupidchicken.com>, Chong Yidong <cyd@stupidchicken.com> writes:

> James Cloos <cloos@jhcloos.com> writes:
> > Yuan> I think the only problem here is :pixelsize=14
> > Yuan> Fontconfig has the format:
> >
> > Yuan> <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>
> >
> > The -<pointsize> part is optional; the comment and the code in font.c
> > acknowledge that fact.  But it clearly doesn't work.

> I've checked in a fix.  I believe this should work correctly now.

Still there's something wrong.  Now ":pixelsize=NN" is
correctly parsed, but the resulting font-spec has peculiar
(almost garbage) :fc-unknown-spec property.

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




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

* Re: Font pixel size selection
  2008-06-16  2:01       ` Chong Yidong
  2008-06-16  4:13         ` Kenichi Handa
@ 2008-06-16  5:18         ` İsmail Dönmez
  1 sibling, 0 replies; 13+ messages in thread
From: İsmail Dönmez @ 2008-06-16  5:18 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Yuan MEI, 402-close, James Cloos, emacs-devel

Hi,

On Mon, Jun 16, 2008 at 5:01 AM, Chong Yidong <cyd@stupidchicken.com> wrote:
> James Cloos <cloos@jhcloos.com> writes:
>
>> Yuan> I think the only problem here is :pixelsize=14
>> Yuan> Fontconfig has the format:
>>
>> Yuan> <families>-<point sizes>:<name1>=<values1>:<name2>=<values2>
>>
>> The -<pointsize> part is optional; the comment and the code in font.c
>> acknowledge that fact.  But it clearly doesn't work.
>
> I've checked in a fix.  I believe this should work correctly now.

Trunk build is broken now:

font.c: In function 'Ffont_face_attributes':
font.c:3788: error: argument 'frame' doesn't match prototype
font.c:3773: error: prototype declaration

This is with GTK+ frontend on GNU/Linux.

Regards,
ismail


-- 
Never learn by your mistakes, if you do you may never dare to try again.




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

* Re: Font pixel size selection
  2008-06-16  4:13         ` Kenichi Handa
@ 2008-06-16 14:36           ` Chong Yidong
  2008-06-17  1:55             ` Kenichi Handa
  0 siblings, 1 reply; 13+ messages in thread
From: Chong Yidong @ 2008-06-16 14:36 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: yuan.mei.list, 402-close, cloos, emacs-devel

Kenichi Handa <handa@m17n.org> writes:

>> I've checked in a fix.  I believe this should work correctly now.
>
> Still there's something wrong.  Now ":pixelsize=NN" is
> correctly parsed, but the resulting font-spec has peculiar
> (almost garbage) :fc-unknown-spec property.

This should be fixed now, too.




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

* Re: Font pixel size selection
  2008-06-16 14:36           ` Chong Yidong
@ 2008-06-17  1:55             ` Kenichi Handa
  2008-06-17  4:37               ` James Cloos
  2008-06-17  5:33               ` Chong Yidong
  0 siblings, 2 replies; 13+ messages in thread
From: Kenichi Handa @ 2008-06-17  1:55 UTC (permalink / raw)
  To: Chong Yidong; +Cc: yuan.mei.list, 402-close, cloos, emacs-devel

In article <87abhl4fcb.fsf@stupidchicken.com>, Chong Yidong <cyd@stupidchicken.com> writes:

> Kenichi Handa <handa@m17n.org> writes:
>>> I've checked in a fix.  I believe this should work correctly now.
> >
> > Still there's something wrong.  Now ":pixelsize=NN" is
> > correctly parsed, but the resulting font-spec has peculiar
> > (almost garbage) :fc-unknown-spec property.

> This should be fixed now, too.

Not yet.

(font-spec :name "mono-10:abc=d:efg") should return
#<font-spec nil nil mono nil nil nil nil nil 10.0 nil nil nil ((:fc-unknown-spec . ":abc=d:efg") (:name . "mono-10:abc=d:efg"))>

but now it returns

#<font-spec nil nil mono nil nil nil nil nil 10.0 nil nil nil ((:fc-unknown-spec . "abc=defg") (:name . "mono-10:abc=d:efg"))>

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




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

* Re: Font pixel size selection
  2008-06-17  1:55             ` Kenichi Handa
@ 2008-06-17  4:37               ` James Cloos
  2008-06-17  5:33               ` Chong Yidong
  1 sibling, 0 replies; 13+ messages in thread
From: James Cloos @ 2008-06-17  4:37 UTC (permalink / raw)
  To: emacs-devel; +Cc: yuan.mei.list, Chong Yidong, 402-close, Kenichi Handa

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

>> This should be fixed now, too.

Handa> Not yet.

Handa> (font-spec :name "mono-10:abc=d:efg") [looses the colon]

A good example of where this will show up, other than pixelsize, is a
synthetic bold oblique, such as:

    (font-spec :name "monospace-9:matrix=1 0.2 0 1:embolden=true")

which returns:

    #<font-spec nil nil monospace nil nil nil nil nil 9.0 nil nil nil
        ((:fc-unknown-spec . "matrix=1 0.2 0 1embolden=true") (:name
        . "monospace-9:matrix=1 0.2 0 1:embolden=true"))>

(My compile is from the 14th.)

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




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

* Re: Font pixel size selection
  2008-06-17  1:55             ` Kenichi Handa
  2008-06-17  4:37               ` James Cloos
@ 2008-06-17  5:33               ` Chong Yidong
  1 sibling, 0 replies; 13+ messages in thread
From: Chong Yidong @ 2008-06-17  5:33 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: yuan.mei.list, 402-close, cloos, emacs-devel

Kenichi Handa <handa@m17n.org> writes:

> (font-spec :name "mono-10:abc=d:efg") should return
> #<font-spec nil nil mono nil nil nil nil nil 10.0 nil nil nil ((:fc-unknown-spec . ":abc=d:efg") (:name . "mono-10:abc=d:efg"))>
>
> but now it returns
>
> #<font-spec nil nil mono nil nil nil nil nil 10.0 nil nil nil ((:fc-unknown-spec . "abc=defg") (:name . "mono-10:abc=d:efg"))>

Okay, now it returns the former.




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

end of thread, other threads:[~2008-06-17  5:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-15  6:31 Font pixel size selection Yuan MEI
2008-06-15  8:41 ` Yuan MEI
2008-06-15 11:12 ` James Cloos
2008-06-15 22:04   ` Yuan MEI
2008-06-15 22:41     ` James Cloos
2008-06-16  2:01       ` Chong Yidong
2008-06-16  4:13         ` Kenichi Handa
2008-06-16 14:36           ` Chong Yidong
2008-06-17  1:55             ` Kenichi Handa
2008-06-17  4:37               ` James Cloos
2008-06-17  5:33               ` Chong Yidong
2008-06-16  5:18         ` İsmail Dönmez
2008-06-16  1:55   ` Kenichi Handa

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.