[Top][All Lists]

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

Re: Testing font things

From: Stefan Monnier
Subject: Re: Testing font things
Date: Tue, 29 Nov 2022 22:48:53 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>>   But this fails because `fonts-at` gets me a "font-object" whereas
>>   `list-fonts` gets me "font entities".  How can I convert one to
>>   the other?
> You should resort to comparing font attributes with `font-get' instead.

I think I can get something acceptable with `font-get`. indeed,
thank you.

> I don't think what you want is reliably possible.

Hmmm... based on my naive understanding of these things I think we
should be able to convert a font-entity into a font-object by calling
the `open_font` method of the font driver.  Of course, this can fail and
it's not free so it's not a good option.

Similarly it should be possible to compare font-object and font-entities
but ignoring the last few fields.  Or offer a function to convert
a font-object or font-entity into a font-spec (similarly by dropping
the last few fields).

Also maybe we can use the FONT_OBJLIST_INDEX field of font-entities to
provide a "font-instance-of" test to see if a font-object is an instance
of a given font-entity.


reply via email to

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