unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* `font-face-attributes' sometimes returns bogus :height value
@ 2008-06-17  3:05 Miles Bader
  2008-06-17  4:55 ` Kenichi Handa
  0 siblings, 1 reply; 8+ messages in thread
From: Miles Bader @ 2008-06-17  3:05 UTC (permalink / raw)
  To: emacs-devel

If `font-face-attributes' is called without a specified height, it
returns an attribute list containing `:height nil', which is invalid.

E.g.

   (font-face-attributes "Dejavu Serif")
   => (:family "Dejavu Serif" :height nil :weight normal :slant normal :width normal)

Since it is quite useful to work with no specified, I think this case
should be supported properly.

To make this work means either omitting the :height attribute entirely
from the returned attribute-list, or alternatively, keeping it, but
using `:height unspecified' for the height.

I dunno what's the preferred way, but I would tentatively favor simply
omitting :height altogether, and making it clear in the function
documentation that the exact order/contents of the returned attribute
list is not guaranteed.

-Miles

-- 
Un-American, adj. Wicked, intolerable, heathenish.




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17  3:05 `font-face-attributes' sometimes returns bogus :height value Miles Bader
@ 2008-06-17  4:55 ` Kenichi Handa
  2008-06-17 14:11   ` Miles Bader
  2008-06-17 14:50   ` Chong Yidong
  0 siblings, 2 replies; 8+ messages in thread
From: Kenichi Handa @ 2008-06-17  4:55 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

In article <buor6awpxqn.fsf@dhapc248.dev.necel.com>, Miles Bader <miles.bader@necel.com> writes:

> If `font-face-attributes' is called without a specified height, it
> returns an attribute list containing `:height nil', which is invalid.

> E.g.

>    (font-face-attributes "Dejavu Serif")
>>> (:family "Dejavu Serif" :height nil :weight normal :slant normal :width normal)

> Since it is quite useful to work with no specified, I think this case
> should be supported properly.

> To make this work means either omitting the :height attribute entirely
> from the returned attribute-list, or alternatively, keeping it, but
> using `:height unspecified' for the height.

I think :weight thru :width should also be omitted or
`unspecified' in the above case.

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




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17  4:55 ` Kenichi Handa
@ 2008-06-17 14:11   ` Miles Bader
  2008-06-17 14:37     ` Chong Yidong
  2008-06-17 14:50   ` Chong Yidong
  1 sibling, 1 reply; 8+ messages in thread
From: Miles Bader @ 2008-06-17 14:11 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel

Kenichi Handa <handa@m17n.org> writes:
>> If `font-face-attributes' is called without a specified height, it
>> returns an attribute list containing `:height nil', which is invalid.
>
> I think :weight thru :width should also be omitted or
> `unspecified' in the above case.

Sounds good to me...

[are you working on this, or do you want me to?]

Thanks,

-Miles

-- 
"Though they may have different meanings, the cries of 'Yeeeee-haw!' and
 'Allahu akbar!' are, in spirit, not actually all that different."




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17 14:11   ` Miles Bader
@ 2008-06-17 14:37     ` Chong Yidong
  0 siblings, 0 replies; 8+ messages in thread
From: Chong Yidong @ 2008-06-17 14:37 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel, Kenichi Handa

Miles Bader <miles@gnu.org> writes:

> Kenichi Handa <handa@m17n.org> writes:
>>> If `font-face-attributes' is called without a specified height, it
>>> returns an attribute list containing `:height nil', which is invalid.
>>
>> I think :weight thru :width should also be omitted or
>> `unspecified' in the above case.
>
> Sounds good to me...
>
> [are you working on this, or do you want me to?]

I'll work on it.




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17  4:55 ` Kenichi Handa
  2008-06-17 14:11   ` Miles Bader
@ 2008-06-17 14:50   ` Chong Yidong
  2008-06-17 21:13     ` Miles Bader
                       ` (2 more replies)
  1 sibling, 3 replies; 8+ messages in thread
From: Chong Yidong @ 2008-06-17 14:50 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: emacs-devel, Miles Bader

Kenichi Handa <handa@m17n.org> writes:

>> If `font-face-attributes' is called without a specified height, it
>> returns an attribute list containing `:height nil', which is invalid.
>
>> E.g.
>
>>    (font-face-attributes "Dejavu Serif")
>>>> (:family "Dejavu Serif" :height nil :weight normal :slant normal :width normal)
>
>> Since it is quite useful to work with no specified, I think this case
>> should be supported properly.
>
>> To make this work means either omitting the :height attribute entirely
>> from the returned attribute-list, or alternatively, keeping it, but
>> using `:height unspecified' for the height.
>
> I think :weight thru :width should also be omitted or
> `unspecified' in the above case.

Why should it affect the :weight and :slant parameters?  The user can
specify "Dejavu Serif Bold Itallic" or "Dejavu Serif:bold:italic", etc.




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17 14:50   ` Chong Yidong
@ 2008-06-17 21:13     ` Miles Bader
  2008-06-18  0:30     ` Kenichi Handa
  2008-06-20 23:23     ` Chong Yidong
  2 siblings, 0 replies; 8+ messages in thread
From: Miles Bader @ 2008-06-17 21:13 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, Kenichi Handa

Chong Yidong <cyd@stupidchicken.com> writes:
>>> To make this work means either omitting the :height attribute entirely
>>> from the returned attribute-list, or alternatively, keeping it, but
>>> using `:height unspecified' for the height.
>>
>> I think :weight thru :width should also be omitted or
>> `unspecified' in the above case.
>
> Why should it affect the :weight and :slant parameters?  The user can
> specify "Dejavu Serif Bold Itallic" or "Dejavu Serif:bold:italic", etc.

I think the main point is that while `font-face-attributes' _can_ return
:weight, :width, etc., parameters, it should only do so if the user
explicitly specified them.  Right now it seems to always do so.

So, ideally:

    (font-face-attributes "Dejavu Serif")
    => (:family "Dejavu Serif")

    (font-face-attributes "Dejavu Serif-10")
    => (:family "Dejavu Serif" :height 100)

    (font-face-attributes "Dejavu Serif Italic")
    => (:family "Dejavu Serif" :slant italic)

etc.

-- 
Conservative, n. A statesman enamored of existing evils, as opposed to a
Liberal, who wants to replace them with new ones.




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17 14:50   ` Chong Yidong
  2008-06-17 21:13     ` Miles Bader
@ 2008-06-18  0:30     ` Kenichi Handa
  2008-06-20 23:23     ` Chong Yidong
  2 siblings, 0 replies; 8+ messages in thread
From: Kenichi Handa @ 2008-06-18  0:30 UTC (permalink / raw)
  To: Chong Yidong; +Cc: miles, emacs-devel

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

> Kenichi Handa <handa@m17n.org> writes:
>>> If `font-face-attributes' is called without a specified height, it
>>> returns an attribute list containing `:height nil', which is invalid.
> >
E.g.
> >
>>> (font-face-attributes "Dejavu Serif")
>>>>> (:family "Dejavu Serif" :height nil :weight normal :slant normal :width normal)
> >
>>> Since it is quite useful to work with no specified, I think this case
>>> should be supported properly.
> >
>>> To make this work means either omitting the :height attribute entirely
>>> from the returned attribute-list, or alternatively, keeping it, but
>>> using `:height unspecified' for the height.
> >
> > I think :weight thru :width should also be omitted or
> > `unspecified' in the above case.

> Why should it affect the :weight and :slant parameters?  The user can
> specify "Dejavu Serif Bold Itallic" or "Dejavu Serif:bold:italic", etc.

Because just "Dejavu Serif" doesn't specify any
style-related properties.

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




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

* Re: `font-face-attributes' sometimes returns bogus :height value
  2008-06-17 14:50   ` Chong Yidong
  2008-06-17 21:13     ` Miles Bader
  2008-06-18  0:30     ` Kenichi Handa
@ 2008-06-20 23:23     ` Chong Yidong
  2 siblings, 0 replies; 8+ messages in thread
From: Chong Yidong @ 2008-06-20 23:23 UTC (permalink / raw)
  To: Kenichi Handa; +Cc: Miles Bader, emacs-devel

>>> If `font-face-attributes' is called without a specified height, it
>>> returns an attribute list containing `:height nil', which is invalid.
>>
>>> Since it is quite useful to work with no specified, I think this case
>>> should be supported properly.
>>
>>> To make this work means either omitting the :height attribute entirely
>>> from the returned attribute-list, or alternatively, keeping it, but
>>> using `:height unspecified' for the height.
>>
>> I think :weight thru :width should also be omitted or
>> `unspecified' in the above case.

Done.




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

end of thread, other threads:[~2008-06-20 23:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17  3:05 `font-face-attributes' sometimes returns bogus :height value Miles Bader
2008-06-17  4:55 ` Kenichi Handa
2008-06-17 14:11   ` Miles Bader
2008-06-17 14:37     ` Chong Yidong
2008-06-17 14:50   ` Chong Yidong
2008-06-17 21:13     ` Miles Bader
2008-06-18  0:30     ` Kenichi Handa
2008-06-20 23:23     ` Chong Yidong

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