[pull_request] #426 loading a default glyphes

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

[pull_request] #426 loading a default glyphes

#1 Post by banduri »

I encountered a bug when i was testing the git branch release-0.4.5. I played it for a while. Since there where autosaves every turn i did not save manualy. I realised, that selecting the "auto" folder in the loadsavegame-dialog was slow (3-5 seconds to list the 10 files). So i started digging. I also was kind of confusing to me, that there are so many systems with the same name. Anyway i used

valgrind --tool=callgrind
gprof2dot -f callgrind -s callgrind.out.1234 > foo.dot
dot -Tsvg -O foo.dot

to generate an svg callgraph. I added a little debug output to see how often that particulare code failed. It was every time on char "0x33f". I did not spend much time on finding that particular char. With the applied patch I also had less problems with the framerate. I'm note sure if it is related to the font-/glyph-cache discussed in the performance thread viewtopic.php?f=9&t=7828&start=30

The main idea of the patch is to introduce a default char that is loaded if FT_Load_Glyph failes to load a particular glyph. The benefits are, that the fontmanager loads and caches the font instead of trieing to load the font, fail and fall back to the DefaultFont.h. This also solved my problem with the 'many systems with the same name' since ":alpha:" is not part of DefaultFont.h.

I'm on archlinux with freetype 2.6.2-1.

(btw: german would be easier for me)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [pull_request] #426 loading a default glyphes

#2 Post by Geoff the Medio »

I don't see a pull request numbered 426 on github...

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#3 Post by banduri »

that's strange. I think did some configurations on my github account. I have to login into github to see my PRs. Without login i cannot see my PR on the freeorion-project.

(btw: the link is correkt)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#4 Post by banduri »

did some more testing and screenshooting with enabled fps, with and without the patch. The patched Version shows a better FPS if text is rendered. The world is 1000Systems, Disc, 20AIs everything else is set to medium. Besides the higher FPS the game is more respnsive to interactions and the alphas and betas are displayed (The selected system in the screenshot is "Dres β" not "Dres "). The ResearchPannel seams to benefit from it too, the framerate increased from 8 to 27FPS here.

System is basicaly an Arch Linux on a midrange laptop in develmode :)
8GB RAM
256GB SSD
Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (Quadcore)
Advanced Micro Devices, Inc. [AMD/ATI] Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (rev ff)
Attachments
closeup without the patch; many text elements; 40 FPS
closeup without the patch; many text elements; 40 FPS
small_patch_closeup_1000_20.jpg (239.88 KiB) Viewed 6749 times
closeup without the patch; many text elements; 18 FPS
closeup without the patch; many text elements; 18 FPS
small_without_patch_closeup_1000_20.jpg (240.48 KiB) Viewed 6749 times
discworld without the patch; few text elements; 60 FPS
discworld without the patch; few text elements; 60 FPS
small_without_patch_discworld_1000_20.jpg (167.67 KiB) Viewed 6749 times
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [pull_request] #426 loading a default glyphes

#5 Post by Vezzra »

Hm, very strange... PR#426 does not exists. Neither does a issue with that number. There is simply no open or closed PR or issue with that number... looks like something went awry on github. Banduri, could you please recreate that PR?

Regarding the actual issue: Once in a while I stumbled across that issue too - built a new version, tested it, suddenly all the greek letters were gone. Deleting config.xml helped in my case.

Nevertheless, if your patch improves performance and offers better fallback handling in case of errors, we should still incorporate it. So, as already mentioned above, pls recreate your PR, so we can take a look at the patch.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [pull_request] #426 loading a default glyphes

#6 Post by Geoff the Medio »

That sounds interesting, but unless you can get the pull request working, there not much we can do with it...

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#7 Post by banduri »

Github had flaged me as a bot :P. Contacted support and it's working now.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: [pull_request] #426 loading a default glyphes

#8 Post by MatGB »

banduri wrote:Github had flaged me as a bot :P. Contacted support and it's working now.
Well, nice to know they have anti-bot procedures, shame they're not perfect. Still, sorted. I have no opinion on the code as it's backend stuff, but wondering if it might be better to load an 'error' glyph instead of a space? Then at least the user would know there's something meant to be there, I'm thinking something similar to the unicode web browser error symbols.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#9 Post by banduri »

MatGB wrote:
banduri wrote:Github had flaged me as a bot :P. Contacted support and it's working now.
Well, nice to know they have anti-bot procedures, shame they're not perfect.
I'm using TorBrowser to access the web. Stuff like that happens all the time. But I've to admit github did a good job :)
MatGB wrote:Still, sorted. I have no opinion on the code as it's backend stuff, but wondering if it might be better to load an 'error' glyph instead of a space? Then at least the user would know there's something meant to be there, I'm thinking something similar to the unicode web browser error symbols.
Thought about that too, but I couldn't find any good/harmless glyph - I'm open for suggestions. The "DEL"-glyph (0x7f) came into my mind, but it is a control char which may interfere otherwise. The NULL (0x00) ... well :). Also the codepoint must be part of most fonts since otherwise russian/chinese may make some problems.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#10 Post by banduri »

banduri wrote:I couldn't find any good/harmless glyph - I'm open for suggestions.
A friend told me I should use
U+FFFD � replacement character used to replace an unknown or unrepresentable character


I tested that one and it looks fine. Will update the PR soon.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [pull_request] #426 loading a default glyphes

#11 Post by Vezzra »

Banduri, we need a license statement from you that you release your contributions according to the licenses the FreeOrion project uses (see here). Probably the best way to do that is to put a respective statement into your sig (see Mats sig as an example).

banduri
Space Floater
Posts: 47
Joined: Tue Dec 15, 2015 6:20 pm
Location: Solaria

Re: [pull_request] #426 loading a default glyphes

#12 Post by banduri »

Vezzra wrote:Banduri, we need a license statement from you that you release your contributions according to the licenses the FreeOrion project uses (see here). Probably the best way to do that is to put a respective statement into your sig (see Mats sig as an example).
sure: GPL v2 or higher is fine with me
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project (this includes pullrequest of the useraccount banduri at github)

Post Reply