COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 08-03-2012, 06:31 PM   #1
liteon
Human being with feelings
 
liteon's Avatar
 
Join Date: Apr 2008
Posts: 510
Default [win32_curses]: small drawing problem

justin,

i've been noticing this strange issue in the jesusonic editor (for a couple of years at least), where the cursor leaves a trail when moved. today i did a test in win32_curses to see if it is also present in there:



there was also something else. "m" and other characters were slightly cropped, which hinted of a possible GetTextMetrics problem...

it seems that GetTextMetrics when used with a font that has fdwQuality = DEFAULT_QUALITY, but ClearType is disabled, gives a result which is slightly off for tmAveCharWidth. using tmMaxCharWidth adds another pixel for this font size (and makes the letters more distant). subtracting one pixel from tmMaxCharWidth goes to the same cropped "m" issue.

i can see you compensate one pixel in the code, based on windows version, but this does not seem to work for the above case.

a solution, i guess, is to enabled/disable ClearType depending on windows version and also shift the position if needed:
Code:
DWORD quality;
if ((GetVersion()&0xFF) >= 6)
  quality = CLEARTYPE_QUALITY;
else
  quality = ANTIALISING_QUALITY;

...
CreateFont(..quality)
...
if ((GetVersion()&0xFF) >= 6) ++txpos;
a better one would be to check if ClearType is enabled:

Code:
UINT smoothing;
if ((GetVersion()&0xFF) >= 6)
  if (SystemParametersInfo(0x200A, 0, &smoothing, 0)) {
    // smoothing == 1 -> default
    // smoothing == 2 -> cleartype
  }

...
CreateFont(..DEFAULT_QUALITY)


...
if (smoothing == 2) ++txpos;
i'm not sending a patch since there are these different solutions and you can decide what's best.

cheers
--

Last edited by liteon; 08-03-2012 at 06:38 PM.
liteon is offline   Reply With Quote
Old 09-13-2012, 06:39 AM   #2
Tranquil
Human being with feelings
 
Join Date: Feb 2005
Location: Greece
Posts: 100
Default

there was a fix for the cursor trails back in 2009.
http://forum.cockos.com/project.php?issueid=824

probably they need to update WDL or something...
Tranquil is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.