A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01845.html below:

Re: Testing font things

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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.


        Stefan




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4