Here is my problem : I have to port an old sofware made for windows NT 4 (i thought) with an old Borland on Windows 7 or newer. The program is running well ( no problem with dependency walker, App Verifier shows a Bad DEVMODE buffer but this error exists on XP and it works well).
The programm have to print a label with some information, this works good on windows XP but on seven numbers are blurry, i don't know why and i don't how to troubleshoot that.
My printer works because i can print a text on seven perfectly and if i print with a pdf printer the problem still the same so i thought that the problem is from windows.
Any idea?
Edit 1 : I have some parts of the source code but parts that were included in the IDE are missing. The printer is not in cause i think because it's the same for the two tests and the problem still here with a PDF printer
here is the source code of print :
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <printers.hpp>
#include "FileCtrl.hpp"
#include "IniFileName.h"
#include "PrnEtiQ.h"
#include "CheckDll.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TEtiquette *Etiquette;
//---------------------------------------------------------------------------
__fastcall TEtiquette::TEtiquette(TComponent* Owner) : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TEtiquette::PrintEti(AnsiString Name,double OD,double OG,double xrb,int PrnIndex)
{
if (PrnIndex==-1) return;
TIniFile * pIni=new TIniFile(GetIniFileName());
if (pIni)
{
DecalX=pIni->ReadInteger("ETIQUETTE","Decal_X",150);
DecalY=pIni->ReadInteger("ETIQUETTE","Decal_Y",0);
pIni->WriteInteger("ETIQUETTE","Decal_X",DecalX);
pIni->WriteInteger("ETIQUETTE","Decal_Y",DecalY);
delete pIni;
}
else
{
DecalX=150;
DecalY=0;
}
LblName->Caption=Name;
PerimDroit->Caption=FormatFloat("##0.0000",OD);
PerimGauche->Caption=FormatFloat("##0.0000",OG);
XRB->Caption=FormatFloat("##0.00",xrb);
Printer()->PrinterIndex=PrnIndex;
int MemoWidth=Width;
int MemoHeight=Height;
Width=MemoWidth+DecalX;
Height=MemoHeight+DecalY;
Panel1->Left=DecalX;
Panel1->Top=DecalY;
Print();
Width=MemoWidth;
Height=MemoHeight;
Panel1->Left=0;
Panel1->Top=0;
}
//---------------------------------------------------------------------------
and here is the .DFM file which describe the shape of the label
object Etiquette: TEtiquette
Left = 167
Top = 149
HorzScrollBar.Visible = False
VertScrollBar.Visible = False
BorderIcons = []
BorderStyle = bsNone
ClientHeight = 33
ClientWidth = 142
Color = clWhite
UseDockManager = True
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial Black'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 18
object Panel1: TPanel
Left = 0
Top = 0
Width = 143
Height = 34
BevelOuter = bvNone
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial Black'
Font.Style = []
ParentFont = False
TabOrder = 0
object PerimGauche: TLabel
Left = 4
Top = 0
Width = 65
Height = 11
AutoSize = False
Caption = '200.00'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object PerimDroit: TLabel
Left = 72
Top = 0
Width = 66
Height = 11
Alignment = taRightJustify
AutoSize = False
Caption = '100.00'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object XRB: TLabel
Left = 40
Top = 12
Width = 57
Height = 11
Alignment = taCenter
AutoSize = False
Caption = '123.45'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentColor = False
ParentFont = False
end
object LblName: TLabel
Left = 4
Top = 20
Width = 42
Height = 14
Caption = '18241_1'
Color = clWhite
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
ParentColor = False
ParentFont = False
end
end
end
As you can see, fonts are hardcoded so i don't think that the problem is there futhermore i checked the fonts and they are in the same version.
Edit 2 : https://drive.google.com/file/d/0B0AeGDmETlPXbGlPX3dUSG1WUzg/view?usp=sharing