[cairo] [PATCH] test: Always use DejaVu Sans as default font

Andrea Canciani ranma42 at gmail.com
Tue Jul 7 06:09:06 PDT 2015

On Tue, Jul 7, 2015 at 2:30 PM, Lawrence D'Oliveiro <ldo at geek-central.gen.nz
> wrote:

> On Mon, 6 Jul 2015 14:24:54 -0700, Bryce Harrington wrote:
> > On Thu, Jul 02, 2015 at 11:52:15AM +0200, Andrea Canciani wrote:
> >
> >> On Thu, Jul 2, 2015 at 12:05 AM, Lawrence D'Oliveiro <
> >> ldo at geek-central.gen.nz> wrote:
> >>
> >>> On Wed,  1 Jul 2015 12:00:49 +0200, Andrea Canciani wrote:
> >>>
> >>>> This change should not affect Linux environments, assuming that
> >>>> the default font is already set to "DejaVu Sans".
> >>>
> >>> On Linux environments, I would expect to see Fontconfig in use.
> >>> This can take a generic name like “Sans Serif” and map it to
> >>> whatever font the user desires.
> >>
> >> Yes, but (for the test suite) if this happens you are likely already
> >> getting failures when you test cairo, because unless the
> >> user-chosen font glyphs have the same shape as the DejaVu Sans
> >> ones, the output of the test cases will not match the reference.
> >> Please notice that most tests already set the font to
> >
> > Right, for the test suite, there is no user to have desires.  :-)
> > Goal is to just make sure results match up to the references.
> However, even a specific-sounding name like “DejaVu Sans” can be
> remapped by Fontconfig. If a test suite can be led astray by vagaries
> of user configuration, then isn’t that a bug in the test suite?

>From that point of view, I believe we expect users to actively try and get
a "working" configuration to pass the test suite (and provide some
directions in test/README).
Just like we are not preventing a user from changing its font
configuration, we cannot really prevent him/her from replacing pixman,
fontconfig, freetype and the whole X server with other libraries/programs
which misbehave in arbitrary ways (possibly preserving the original API,
but completely changing the behaviour).
I do not think that making the testsuite "completely" robust (for example
by including all of the cairo dependencies as submodules and using them in
a more controlled way) is a good target. Instead I agree that for some
resources (like fonts) we should try harder to bundle them: currently we do
not even check if the font subsystem knows about DejaVu, so it is very easy
to end up running the test suite in an environment which is missing some
fonts (this is especially true on Windows and MacOSX, I believe).

> If you want to depend on a specific font in the test suite, then the
> font needs to be included in the test suite.

That's a long standing issue (unrelated to this change), which is even
mentioned in the test/README file:

"We are constantly working to reduce the number of variables that need
to be tweaked to get a clean run, (for example, by bundling fonts with
the test suite itself), and also working to more carefully document
the software configuration used to generate the reference images."

IIRC there are some licensing issues that might prevent us from bundling
the DejaVu font with the test suite.
We might eventually decide to bundle another font (for example we use the
public domain font test/6x13.pcf), or at least to provide an automated way
to fetch the appropriate files from a trusted source (Debian packages?).
This seems to be material for an independent discussion, though.


> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20150707/5c858f2a/attachment-0001.html>

More information about the cairo mailing list