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

Problem with text rendering in high resolution? #22

Open
drewish opened this issue Jan 11, 2017 · 5 comments
Open

Problem with text rendering in high resolution? #22

drewish opened this issue Jan 11, 2017 · 5 comments

Comments

@drewish
Copy link
Contributor

drewish commented Jan 11, 2017

I noticed that one of the samples have settings->setHighDensityDisplayEnabled(); but one app has it commented out.

Disabled:
screen shot 2017-01-10 at 11 30 15 pm

Enabled:
screen shot 2017-01-10 at 11 30 34 pm

Text seems equally blurry in both cases but in the enabled case it seems more desaturated.

Curious if you've any idea what's going on with it.

@cwhitney
Copy link
Owner

Will take a look. Pretzel is due for some sprucing up overall, this is a good place to start

@drewish
Copy link
Contributor Author

drewish commented Jan 11, 2017

I wonder if it's just a a problem with TextureFont. i started testing out TextureFontApp and it seems to be similarly afflicted at smaller sizes. I posted some screenshots on: http://discourse.libcinder.org/t/pixalated-font-on-retina-display/435/5

Something like https://github.com/chaoticbob/Cinder-SdfText might give better results but I'm not sure it'd make sense to have this block depending that.

@cwhitney
Copy link
Owner

A hacky solution might be to draw the type twice as large and draw it at 50% if that's the case.

@drewish
Copy link
Contributor Author

drewish commented Jan 11, 2017

yeah if that'd fix it, it seems like something the TextureFont should be doing. i'll try to do some experimentation since i've got another feature i'm working on that needs to do some text rendering.

@lmaw
Copy link

lmaw commented Jul 9, 2018

Hi,
Change these lines in renderTextInternal(PretzelGlobal.cpp)

guiFont->drawString(text, ci::vec2(-textSize.x, 0) + pos + ci::vec2(0,emHeight), opts); guiFont->drawString(text, ci::vec2((int)textSize.x*-0.5, 0) + pos + ci::vec2(0,emHeight), opts); guiFont->drawString(text, pos + vec2(0,emHeight), opts); ci::Font tmp("Arial", 16); emHeight = floor( guiFont->measureString("M").y );

to this

guiFont->drawString(text, ci::vec2(-textSize.x * 0.65, 0) + pos + ci::vec2(0,emHeight),gl::TextureFont::DrawOptions().scale( 0.5f ).pixelSnap( false ) ); guiFont->drawString(text, ci::vec2((int)textSize.x*-0.5, 0) + pos + ci::vec2(0,emHeight),gl::TextureFont::DrawOptions().scale( 0.5f ).pixelSnap( false ) ); guiFont->drawString(text, pos + vec2(0,emHeight), gl::TextureFont::DrawOptions().scale( 0.5f ).pixelSnap( false ) ); ci::Font tmp("Arial", 21); emHeight = floor( guiFont->measureString("M").y * 0.55 );

Before and after screeshots's /
https://imgur.com/gallery/oSiWjS2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants