[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:31:26 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> I'm trying to write a test for our font choice code (bug#59347)
> Is it useful?

We've had a fair bit of regressions in our font-selection code over the
years, and some of those have happened several times, so I think it
would be useful, yes.

> This test will work only on your platform and maybe on a few
> other lucky ones.

Sounds like a good reason to add more tests to cover other cases.
[ FWIW, Dejavu Sans is very widespread under GNU/Linux, AFAIK, and
  misc-fixed used to be very widespread as well, so there's a chance
  I'm not the only one where this test can run.  ]

> I suggest to defer coding of the test until we fully understand the
> problem, and then try to write the test in some generic way
> independent of specific font families.

Writing tests for the font code is not super easy, so I'd rather we get
started earlier than wait for some hypothetical future.  It's much
easier to improve/extend existing tests than trying to figure out how
the hell can we test GUI code in batch mode.

> ...why do you need to go to these obscure entities, when you have the font's
> name as a string to begin with?  So you should be able to:
>   . use face-font, which returns the font's name as a string

I'm not sure `face-font` will faithfully reproduce the result I'll see
on my screen.

>   . compare that string with what you wanted it to be

I'd rather not hard code any specific font name, actually, which is why
my code was written to just check that we get one of the available fonts
from the "DejaVu Sans" family.

>   . and/or use find-font to check whether the font is in fact installed on
>     the system

How does that compare to `list-fonts`?


reply via email to

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