Modify

Opened 9 months ago

Last modified 9 months ago

#23255 new defect

[PATCH] Some MapCSSRendererTest reference images were rendered with the wrong font

Reported by: marcello@… Owned by: team
Priority: normal Milestone:
Component: Unit tests Version:
Keywords: Cc:

Description

The reference image test/data/renderer/node-text2/reference.png was rendered with the "DejaVu Sans" font instead of the correct "Droid Sans". You can see that by looking at the "g" character, which has a closed tail in "Droid Sans".

Same goes for test/data/renderer/eval/reference.png

Attachments (1)

23255.patch (3.9 KB ) - added by marcello@… 9 months ago.
This patch corrects the mapcss for the tests to match the fonts used in the images.

Download all attachments as: .zip

Change History (6)

by marcello@…, 9 months ago

Attachment: 23255.patch added

This patch corrects the mapcss for the tests to match the fonts used in the images.

comment:1 by marcello@…, 9 months ago

Summary: Some MapCSSRendererTest reference images were rendered with the wrong font[PATCH] Some MapCSSRendererTest reference images were rendered with the wrong font

comment:2 by taylor.smock, 9 months ago

Did you consider updating the reference images instead? Set UPDATE_ALL to true.

Last edited 9 months ago by taylor.smock (previous) (diff)

comment:3 by marcello@…, 9 months ago

Of course not! If I tested my renderer against an image that my renderer itself produced, it wouldn't make sense?

OTOH the font in the repository is clearly not Droid Sans:

https://github.com/JOSM/josm/blob/master/test/data/renderer/node-text2/reference.png

This is Droid Sans, look at the 'g':

https://fonts.adobe.com/fonts/droid-sans#fonts-section

comment:4 by taylor.smock, 9 months ago

If I tested my renderer against an image that my renderer itself produced, it wouldn't make sense?

How do you think the images are generated? We generally regenerate them when the test starts failing on a new Java version.

Anyway, one of two things is true:

  • Someone generated the rendered images with Helvetica and the reference images were never updated since r7383 (I used the Helvetica font in Libreoffice to check). I'm not certain why they still pass. Probably an environment variable is wrong or something.
  • Someone generated the rendered images by hand and expected us to be using Helvetica for the font.

Of the two options, I strongly suspect that the author generated the images from a "known-good" point with the intent of using them for regression testing.

comment:5 by marcello@…, 9 months ago

It probably is DejaVu Sans, not Helvetica. DejaVu matches perfectly. And Helvetica is non-free.

The test only makes sense if I compare the results of my patched renderer against the results of a known-good renderer. So I can confirm that my patches didn't break anything.

You may either use my patch to fix the MapCSS or regenerate the images with the old MapCCS and the correct font.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to marcello@….
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.