From 8b7cb5ce26288f28bff7420bf69be357d30106c8 Mon Sep 17 00:00:00 2001 From: Raymond Date: Sun, 9 May 2010 22:54:34 +0200 Subject: [PATCH] Volgens mij heb ik dit gesloopt ofzo --- Projects/OCRBench/unit1.pas | 3 ++- Units/MMLCore/libloader.pas | 4 +++- Units/MMLCore/ocr.pas | 9 ++++++--- Units/PascalScript/uPSI_Dialogs.pas | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Projects/OCRBench/unit1.pas b/Projects/OCRBench/unit1.pas index 1a8069c..2bd31e3 100644 --- a/Projects/OCRBench/unit1.pas +++ b/Projects/OCRBench/unit1.pas @@ -96,7 +96,7 @@ begin // DS + .. + DS because InitOCR wants the directory of the Fonts, not UpChars // only. C.MOCR.InitTOCR(FontPath + DS); - C.MOCR.SetFonts(C.MOCR.GetFonts); + //C.MOCR.SetFonts(C.MOCR.GetFonts); t:=gettickcount; @@ -125,6 +125,7 @@ begin Form1.Image1.Picture.SaveToFile(OCRDebugPath + 'ocrbench.bmp'); {$ENDIF} + bmp.OnDestroy:=nil; bmp.Free; C.Free; Application.ProcessMessages; diff --git a/Units/MMLCore/libloader.pas b/Units/MMLCore/libloader.pas index 1220a5f..a535089 100644 --- a/Units/MMLCore/libloader.pas +++ b/Units/MMLCore/libloader.pas @@ -36,7 +36,7 @@ interface implementation uses - MufasaTypes,MufasaBase,FileUtil; + MufasaTypes,MufasaBase,FileUtil, strutils; procedure TGenericLoader.AddPath(path: string); var @@ -101,6 +101,8 @@ implementation function TGenericLoader.VerifyPath(Path: string): string; begin + if (@path = nil) or (path = '') then + exit(''); Result := Path; if (Result[Length(Result)] <> DS) then begin; diff --git a/Units/MMLCore/ocr.pas b/Units/MMLCore/ocr.pas index a745a0a..5a4b8d1 100644 --- a/Units/MMLCore/ocr.pas +++ b/Units/MMLCore/ocr.pas @@ -41,9 +41,6 @@ type private Client: TObject; FFonts: TMFonts; - {$IFDEF OCRDEBUG} - debugbmp: TMufasaBitmap; - {$ENDIF} function GetFonts:TMFonts; procedure SetFonts(const NewFonts: TMFonts); public @@ -71,6 +68,8 @@ type property Fonts : TMFonts read GetFonts write SetFonts; {$IFDEF OCRDEBUG} procedure DebugToBmp(bmp: TMufasaBitmap; hmod,h: integer); + public + debugbmp: TMufasaBitmap; {$ENDIF} end; @@ -156,16 +155,20 @@ begin {$ENDIF} if FFonts.LoadFont(dirs[i], false) then begin + {$IFDEF FONTDEBUG} fonts_loaded := fonts_loaded + dirs[i] + ', '; + {$ENDIF} result := true; end; end; + {$IFDEF FONTDEBUG} if length(fonts_loaded) > 2 then begin writeln(fonts_loaded); setlength(fonts_loaded,length(fonts_loaded)-2); TClient(Self.Client).WriteLn('Loaded fonts: ' + fonts_loaded); end; + {$ENDIF} If DirectoryExists(path + 'UpChars') then FFonts.LoadFont('UpChars', true); // shadow end; diff --git a/Units/PascalScript/uPSI_Dialogs.pas b/Units/PascalScript/uPSI_Dialogs.pas index 893f93e..52721f6 100644 --- a/Units/PascalScript/uPSI_Dialogs.pas +++ b/Units/PascalScript/uPSI_Dialogs.pas @@ -27,7 +27,7 @@ type implementation uses - Windows ,Messages ,CommDlg ,Graphics ,Controls ,Forms ,StdCtrls ,Dialogs; + { Windows ,}lcltype,Messages {,CommDlg },Graphics ,Controls ,Forms ,StdCtrls ,Dialogs; (* === compile-time registration functions === *) (*----------------------------------------------------------------------------*)