[pull_request] #426 loading a default glyphes
Moderator: Committer
[pull_request] #426 loading a default glyphes
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)
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)
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull_request] #426 loading a default glyphes
I don't see a pull request numbered 426 on github...
Re: [pull_request] #426 loading a default glyphes
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)
(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)
Re: [pull_request] #426 loading a default glyphes
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)
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
- small_patch_closeup_1000_20.jpg (239.88 KiB) Viewed 6758 times
-
- closeup without the patch; many text elements; 18 FPS
- small_without_patch_closeup_1000_20.jpg (240.48 KiB) Viewed 6758 times
-
- discworld without the patch; few text elements; 60 FPS
- small_without_patch_discworld_1000_20.jpg (167.67 KiB) Viewed 6758 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)
Re: [pull_request] #426 loading a default glyphes
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.
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull_request] #426 loading a default glyphes
That sounds interesting, but unless you can get the pull request working, there not much we can do with it...
Re: [pull_request] #426 loading a default glyphes
Github had flaged me as a bot . 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)
Re: [pull_request] #426 loading a default glyphes
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.banduri wrote:Github had flaged me as a bot . Contacted support and it's working now.
Mat Bowles
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: [pull_request] #426 loading a default glyphes
I'm using TorBrowser to access the web. Stuff like that happens all the time. But I've to admit github did a good jobMatGB wrote:Well, nice to know they have anti-bot procedures, shame they're not perfect.banduri wrote:Github had flaged me as a bot . Contacted support and it's working now.
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.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.
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)
Re: [pull_request] #426 loading a default glyphes
A friend told me I should usebanduri wrote:I couldn't find any good/harmless glyph - I'm open for suggestions.
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)
Re: [pull_request] #426 loading a default glyphes
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).
Re: [pull_request] #426 loading a default glyphes
sure: GPL v2 or higher is fine with meVezzra 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).
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)