GNOME Bugzilla – Bug 573178
Add Tango style cards to aisleriot
Last modified: 2011-12-07 12:34:14 UTC
The card games are probably among the most played GNOME games. But they still lack a modern look that matches the rest of the desktop. I created a card set that tries to follow the Tango style guidelines. Maybe it could be integrated into gnome-games or gnome-games-extra-data or at least serve as a starting point for tangofication of aisleriot. The card set is entirely my own work and dual-licesed under GPLv2 or later and CC-By-SA.
Created attachment 129512 [details] SVG file for a tango-style card set
Thanks! The cards look nice. There appear to be a few problems though: - the Q of clubs, and the 2 and 3 of diamonds don't show up in aisleriot, the corresponding IDs are missing in the SVG - when they cards stacked you can only see the rank of the card and not its suit (to see this, use e.g. aisleriot freecell game) - loading seems a bit slower than with our current default theme (Gnomangelo Bitmap)...
I actually thought that the current cards were tango(-ish) except for the black? Maybe they are not. I'm colorblind so I wouldn't know. But that was what I was told. One thing that is closely related and would be very much appreciated is better background graphic. The file is aisleriot/baize.png If you could provide us with a prettier tango background then I will provide you beer if we ever meet :) Same goes for the card backside. I like the current look but if the color is off then a tangoified version would be appreciated
Thanks for your comments! I'll try to comment on the issues. > There appear to be a few problems though: > - the Q of clubs, and the 2 and 3 of diamonds don't show up in aisleriot, the > corresponding IDs are missing in the SVG I cannot confirm that. I tried it in several SVG viewers (Opera, Batik, and - most important in this case - rsvg) and they all displayed the file correctly. The only one with problems was Firefox, and there indeed some card values were randomly missing. If you actually have that issue within the games, I'll try some further investigation. > - when they cards stacked you can only see the rank of the card and not its > suit (to see this, use e.g. aisleriot freecell game) Right, thanks for pointing out. I'll upload a version that has a small suit symbol in the opposite corner. That corner was a bit empty, anyway. > - loading seems a bit slower than with our current default theme (Gnomangelo > Bitmap)... I agree, loading time is absolutely an issue. The default theme uses bitmaps for the most complex parts, the characters (Gnomangelo, and Bonded does the same). I don't know what actually makes rendering take so long, but rsvg needs more than 3 seconds on my laptop to render the SVG file, which is quite long. One solution would probably be pre-rendering (at least) the characters and embed them as bitmap. But that might imply some quality trade-off. And I'm not sure that's worth it (I just tried a version with only the characters replaced by bitmaps, it still takes more than 2.5 secs). Any suggestions as how to speed up the rendering?
Created attachment 129604 [details] SVG file for a tango-style card set (updated)
(In reply to comment #4) > > There appear to be a few problems though: > > - the Q of clubs, and the 2 and 3 of diamonds don't show up in aisleriot, the > > corresponding IDs are missing in the SVG > I cannot confirm that. I tried it in several SVG viewers (Opera, Batik, and - > most important in this case - rsvg) and they all displayed the file correctly. > The only one with problems was Firefox, and there indeed some card values were > randomly missing. The problem is not in the display in a svg viewer; it's simply that the id attributes for these cards are missing in the svg file, so aisleriot cannot load these cards. To see the problem, simply put the svg in the card theme directory (usually /usr/share/gnome-games-common/cards), start aisleriot and choose the svg by name in the View, Card style menu. [More info here: http://live.gnome.org/GnomeGames/CardThemeFormat ] > I agree, loading time is absolutely an issue. The default theme uses bitmaps > for the most complex parts, the characters (Gnomangelo, and Bonded does the > same). I don't know what actually makes rendering take so long, but rsvg needs > more than 3 seconds on my laptop to render the SVG file, which is quite long. > > One solution would probably be pre-rendering (at least) the characters and > embed them as bitmap. But that might imply some quality trade-off. And I'm not > sure that's worth it (I just tried a version with only the characters replaced > by bitmaps, it still takes more than 2.5 secs). > > Any suggestions as how to speed up the rendering? It might be the use of the gradients that slows it down; librsvg isn't very fast with gradients.
> The problem is not in the display in a svg viewer; it's simply that the id > attributes for these cards are missing in the svg file, so aisleriot cannot > load these cards. To see the problem, simply put the svg in the card theme > directory (usually /usr/share/gnome-games-common/cards), start aisleriot and > choose the svg by name in the View, Card style menu. Oh, of course you're right. I added the missing IDs. In GNOME 2.22 the cards do load properly even with the missing IDs, so I didn't notice that before. (Of course did I test the theme before ;-) ) > It might be the use of the gradients that slows it down; librsvg isn't very > fast with gradients. That sounds plausible. I tried not to use too many gradients, but I think some are required for a Tango-ish look. I'll see if there are gradients that can be replaced by flat colors without loosing too much of the intended style.
Created attachment 129616 [details] SVG file for a tango-style card set (updated, added IDs)
I tried replacing all gradients in the suit symbols and values with flat colors (except for the large ones in the center of the Ace cards). I kept the gradients for the characters, since I think that removing them there takes much from their appeal. Some timing tests showed only little speed improvement, if any. So I don't have the impression that it's easy to get significant speedup this way. So what would you suggest? Is this a show-stopper or could the theme be included anyway? Does rsvg support some sort of profiling, to get more detailed information what exactly takes the most time?
This card set is OK, and could be accepted into the gnome-games-extra-data package. I don't think it should replace the current default card set in Aisleriot...
(In reply to comment #10) > This card set is OK, and could be accepted into the gnome-games-extra-data > package. I don't think it should replace the current default card set in > Aisleriot... gnome-games-extra-data ist totally ok for me. At least the speed issue prevents it from being a default theme.
Looking at the SVG source of this card theme, I noticed lots of repeated and probably unnecessary style declarations; it's possible that that's slowing it down too? I agree that this is a nice theme that we should have at least in g-g-extra-data. I'll add it. Also, the creators of the card themes are credited in aisleriot's about window (in the "Credits" window, "Artists" tab). Is it ok to add you there? Do you want name-only, or with an email address (in that case, tell me which address to use.)
(In reply to comment #12) > I agree that this is a nice theme that we should have at least in > g-g-extra-data. I'll add it. Thanks! > Also, the creators of the card themes are credited in aisleriot's about window > (in the "Credits" window, "Artists" tab). Is it ok to add you there? Do you > want name-only, or with an email address (in that case, tell me which address > to use.) Simply take my name and email from here (Frederik Elwert <frederik.elwert@web.de>).
Actually I forgot one thing: we need a name for the card set, to be shown in the menus :) Any suggestions? (Oh and I noticed that for the other artists we point to a web site; so if you have a website with your artwork that you want to point to instead of the email, we can do that.)
Concerning the name: What about "Tango"? ;-) If someone comes up with something more poetical, I'm ok with that. :-) Concerning the website: No, I have no web site with my artwork (I'm not even an artist, to be honest). So my email address is totally fine.
Done: added tango.svg to g-g-extra-data and updated credits in aisleriot. Thanks!
Created attachment 135587 [details] Cleaned-up version of the SVG file I just ran scour <http://codedread.com/scour/> over the SVG file to clean it up a bit. Against my hope, rendering speed didn’t improve significantly. But since the file size is now about 60% of the original file, I thought it might be worth uploading the new file. Maybe someone can check it in.
Reopening so the update doesn't get lost. Have you checked if the rendering is pixel-by-pixel identical to the one from the old set?
Ah, thanks for reopening. And yes, the rendering is identical to the old one.
Unfortunately it turns out that there *are* subtle rendering differences...
Oh, I’m sorry, I didn’t notice any when I tested it. How did you notice and what are the consequences? Does it impact the quality?
I used the gnome-games-render-cards utility to create PNGs from both the old and the new theme, and compared them. The differences are subtle, but that they differ at all doesn't inspire much confidence in the "scour" tool to reduce the svg files. Since the rendering time was virtually unchanged too, I'm unsure if the file size gain alone justifies replacing the file with the reduced one.
Thanks for the hint, I din’t know gnome-games-render-cards. Scour uses some techniques that aren’t 100% loss-free. The question for me would be: Would I have been unsatisfied if the image looked like that in the first place? ;-) But I understand your concers, so just do what ever you think is best. :-)
This card set has been in gnome-games-extra-data before, and is now part of aisleriot since the split from gnome-games. And the credits are documented in the about dialogue. So I'm closing this bug — thanks again for the contribution :-)