Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL2 - add font_hinting property to Label #2898

Closed
dessant opened this issue Jan 25, 2015 · 15 comments
Closed

SDL2 - add font_hinting property to Label #2898

dessant opened this issue Jan 25, 2015 · 15 comments
Milestone

Comments

@dessant
Copy link
Contributor

dessant commented Jan 25, 2015

As @tito noted, t-s and f-s are not displayed correctly with Roboto.
With pygame the issue does not seem to be present.

Update: ignore the pygame - master image.
screenshot from 2015-01-25 15 02 34

UPDATE:
This is the light_hint branch 17ff7d3.

Code used:

from kivy.app import App
from kivy.lang import Builder
from kivy.factory import Factory

kv = """
<Test@Label>:
    text: 'settings free'
    on_size: print(self.font_name)
"""

Builder.load_string(kv)


class TestApp(App):
    def build(self):
        return Factory.Test()

if __name__ == '__main__':
    TestApp().run()

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@dessant dessant added this to the 1.9.0 milestone Jan 25, 2015
@dessant
Copy link
Contributor Author

dessant commented Jan 25, 2015

What's even stranger is that pygame displays a different glyph for "g". The correct glyph for it in Roboto is the one rendered by sdl2.

Update: it seems like pygame swaps the whole font for some reason.

@thopiekar
Copy link
Contributor

same with the "s"

@dessant
Copy link
Contributor Author

dessant commented Jan 25, 2015

If Roboto-Regular.ttf is specified for the Label's font_name, it is displayed just like with sdl2, so this pygame font swap seems to be a kivy bug, not pygame.

@dessant
Copy link
Contributor Author

dessant commented Jan 25, 2015

I have messed up something, that's why pygame used a different font. :|
I've repulled and now the default font is shown, it looks just like with sdl2:
screenshot from 2015-01-25 23 38 41

@tito
Copy link
Member

tito commented Jan 25, 2015

I think the safer solution is to rollback the commit, and get it right for the next version, even if it's a minor. The current changes are not acceptable for a release :/

@dessant
Copy link
Contributor Author

dessant commented Jan 25, 2015

@tito maybe that would be the best.
Have you tried the light_hint branch?

@FeralBytes
Copy link
Contributor

So will this be removed from the 1.9.0 milestone requirements?

@dessant
Copy link
Contributor Author

dessant commented Jan 26, 2015

@FeralBytes first we should try to make it work, one proposal is rather simple and it would fix a bug in 1.9: some fonts are not displayed correctly and they cannot be tweaked because we do not have a hint api for example.

@FeralBytes
Copy link
Contributor

@dessant OK. I just keep seeing 1.9l0 move further and further back as more issues are tagged 1.9.0.

@dessant
Copy link
Contributor Author

dessant commented Jan 26, 2015

@FeralBytes help us decrease that list faster. ;)

@dessant
Copy link
Contributor Author

dessant commented Jan 26, 2015

@FeralBytes maybe try out the light_hint branch with some fonts and report back, that would help a lot.

@FeralBytes
Copy link
Contributor

@dessant I wish I had more time on my hands. I truely am sorry, that I do not. I am not posting to critize your work. Just have not been able to find a clear plan for what is 1.9.0. So I have been using the Milestone tag, and seeing the number of open issues going backwards indicates that 1.9.0 has not been put into any sort of freeze. Normally for software release there is a freeze period, where no new features are added. This light_hint seems to be an all new feature, and an addition to the API. I understand it is fixing a bug. But what is 1.9.0 supposed to look like, will there be a freeze in the near future?

@dessant dessant changed the title SDL2 - Roboto is not displayed correctly SDL2 - some fonts are not displayed correctly Jan 26, 2015
@dessant
Copy link
Contributor Author

dessant commented Jan 27, 2015

The default font change has been reverted, we need to investigate this further.

@dessant dessant modified the milestones: 1.9.1, 1.9.0 Jan 27, 2015
@dessant
Copy link
Contributor Author

dessant commented Aug 10, 2015

We've recently switched to Roboto, the hinting issue has been fixed in the latest version of the font.
A font_hinting property should be implemented to avoid issues with other custom fonts.

@dessant dessant changed the title SDL2 - some fonts are not displayed correctly SDL2 - add font_hinting property to Label Aug 10, 2015
@dessant dessant modified the milestones: 1.9.2, 1.9.1 Oct 22, 2015
@dessant
Copy link
Contributor Author

dessant commented Feb 6, 2016

Implemented in #3896.

@dessant dessant closed this as completed Feb 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants