Yes like HontoNiBaka said each site will be different in font style and text layout. Some will align the text left, some right, some will center the text and if it's centered the digits will move coordinates based on the length of the stack size.
Regarding Anti-Aliasing aka ClearType, I've been looking into possibly disabling AA while I capture my initial image then immediately re-enabling it. I'm not sure if this is a good idea or not but here are the two .reg insctructions to enable and disable them
Disable ClearType and antialiasing Code:
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="0"
"FontSmoothingType"=dword:00000000
Enable cleartype and antialiasing Code:
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
to the best of my knowledge in c# it would be something like this
Code:
//Set Reg Key
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
//Disable AA & ClearType
key.SetValue("FontSmoothing", 0, RegistryValueKind.String);
key.SetValue("FontSmoothingType", 0, RegistryValueKind.DWord);
//Grab Screenshot
YouScreenshotMethod();
//Enable AA & ClearType
key.SetValue("FontSmoothing", 2, RegistryValueKind.String);
key.SetValue("FontSmoothingType", 2, RegistryValueKind.DWord);
For getting centered text one character at a time, one idea I could think of to try and work around the locations would be to grab the rectangle for the entire stack size then run color detection pixel by pixel(pretty sure the best way to do this is to convert the image to a byte array) to get a grid of what pixels are text or background. Then parse through all the coordinates and find the first pixel that's the text color(the lowest X value that matches) and that would be where your first digit starts and you can make you first single character box(be sure to subtract the X value by one). Then knowing the size of each character you can keep making boxes, checking each one for the text color until you get a box that has no text color which means the last box was our last character.
Also you could possibly try to find the memory address for each stack using memory scanning software like cheat engine, but each time the program updates, the memory addresses will change and you would have to re-find them. but when using OCR once you have it working the locations more than likely wont change unless a major update occurs and they revamp their table layout.
Again not an expert, I just enjoy playing with this kind of stuff. Double check any information for yourself, good luck!