From: Reaves, T. <tr...@si...> - 2013-10-01 18:44:46
|
That's fine. I had tried (although very possibly incorrectly) to do as you say and use @2x at init time, but, it didn't work. I'll try your code once pushed, and see what happens. As for point/pixel, the Qt docs explicitly state that when using pixel instead of point, they are then device-dependent. But it's really not worth arguing about. On Tue, Oct 1, 2013 at 2:05 PM, Fabien Chéreau <fab...@gm...>wrote: > Hi Tim, > From > http://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/ it > seems that when Info.Plist contains the necessary options, most of Qt > code doesn't need to be changed. > <key>NSPrincipalClass</key> > <string>NSApplication</string> > <key>NSHighResolutionCapable</key> > <string>True</string> > Currently we have this already set (excepted that we have a "YES" instead > of "true". I hope it's fine). > > With this settings, all QWidgets and Qml stuff should be properly scaled > already. The only problem we have is for OpenGL rendering: for a retina > screen OpenGL pixels are twice smaller than the device-independent pixels > used by Qt. What still needs to be done then is the following: > > - the OpenGL viewport need to be 2x larger. It's what you did although I > think a cleaner implementation should not touch the internals of the > StelProjector class. It's enough to apply x2 factor at init time. > - text rendered directly in openGL, using StelPainter::drawText. For this > it should be enough to set the proper pixelRatio to the QOpenGLPaintDevice > used locally in this function. The ratio can be obtained in the method > simply using QOpenGLContext::currentContext().screen().devicePixelRatio(). > > And most importantly, I don't really like the fact that we move to Point > size instead of pixel size because it's not backward compatible (a user > with an existing config.ini will get large fonts), and also because usually > devices with higher screen density use smaller font size (in point) because > we stay closer to the screen, the opposite also applies to large screens > like a TV. In Qt they created the notion of "Device-Independent Pixel" for > this reason. > > If it's OK with you, I will do some cleanup in the code and revert the > commit where all setPixelSize are converted to setPointSize. The pixels > will really be "Device-Independent Pixel", which means that the behavior > should be fine on mac retina as well. > > Fabien > > > On Sat, Sep 28, 2013 at 3:23 AM, Reaves, Timothy < > tr...@si...> wrote: > >> On Linux, the fonts aren't huge; they are 13 point. As-in the same size >> as 13 point fonts in other applications. And the code now shows fonts the >> same relative size on all devices, instead of device-dependent pixels. So >> I'm not sure what you mean by 'pretty broken'. If you mean that you would >> prefer the fonts to be smaller than 13 point, I understand that; but a >> better solution is still to specify them in device-independent points >> instead of device-dependent pixels. >> >> If on the other had you mean the changes to the StelProjector & >> StelProjectorParams, my code was an attempt to fix what was broken by your >> merge to trunk. Where I had pointed out twice that your branch was - well, >> broken. So, again, an attempt to fix what is already broken on trunk makes >> perfect sense to perform on trunk. >> >> But thanks for finally noticing. >> >> >> On Fri, Sep 27, 2013 at 3:09 PM, Fabien Chéreau <fab...@gm... >> > wrote: >> >>> It's also pretty broken here (huge fonts). I'll try to have a look this >>> WE. In general I think this kind of changes should be done first in a >>> branch so that we can merge only working code (this kind of >>> device-dependent stuff is hard to get right). >>> Fabien >>> >>> >>> On Fri, Sep 27, 2013 at 7:47 PM, Reaves, Timothy < >>> tr...@si...> wrote: >>> >>>> Corrected. >>>> >>>> >>>> On Fri, Sep 27, 2013 at 1:23 PM, Alexander Wolf <ale...@gm...>wrote: >>>> >>>>> Hi, >>>>> >>>>> 2013/9/27 Reaves, Timothy <tr...@si...> >>>>> >>>>> This is working on my machine, in all scenarios (it has one Retina & >>>>>> one non- screen). >>>>>> Please let me know of any issues, or feel free to do something >>>>>> different. >>>>>> >>>>> >>>>> I'm checked it on linux and found wrong size of display. >>>>> >>>>> -- >>>>> With best regards, Alexander >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> October Webinars: Code for Performance >>>>> Free Intel webinars can help you accelerate application performance. >>>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the >>>>> most from >>>>> the latest Intel processors and coprocessors. See abstracts and >>>>> register > >>>>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >>>>> _______________________________________________ >>>>> Stellarium-pubdevel mailing list >>>>> Ste...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel >>>>> >>>>> >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> October Webinars: Code for Performance >>>> Free Intel webinars can help you accelerate application performance. >>>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the >>>> most from >>>> the latest Intel processors and coprocessors. See abstracts and >>>> register > >>>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >>>> _______________________________________________ >>>> Stellarium-pubdevel mailing list >>>> Ste...@li... >>>> https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel >>>> >>>> >>> >>> >>> ------------------------------------------------------------------------------ >>> October Webinars: Code for Performance >>> Free Intel webinars can help you accelerate application performance. >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >>> from >>> the latest Intel processors and coprocessors. See abstracts and register >>> > >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Stellarium-pubdevel mailing list >>> Ste...@li... >>> https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel >>> >>> >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >> from >> the latest Intel processors and coprocessors. See abstracts and register > >> >> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >> _______________________________________________ >> Stellarium-pubdevel mailing list >> Ste...@li... >> https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel >> >> > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk > _______________________________________________ > Stellarium-pubdevel mailing list > Ste...@li... > https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel > > |