SRL Archive - General

OCR in scar?


shadowpwner

2007-08-08 00:21:16

Is there an include or script would do OCR for a certain font?

Or would I have to make bitmaps of each character?

Thanks in advance.

Markus

2007-08-08 04:16:12

Search in the scar manual for LoadCharsFromFont

n3ss3s

2007-08-08 05:15:43

TheBitmap := CreateBitmapMaskFromText('OCR', TheFontHere)
The fonts are found in SCAR >> Font >>

shadowpwner

2007-08-08 15:26:03

Thanks for the replies, I think I know how to use the font now.

Thanks!

shadowpwner

2007-08-08 22:33:29

whered the edit button go?
so my question is,
do i need to specify what size the font is, or bold or italic?

(suppose i wanted myriad pro bold size 28.5)

Smartzkid

2007-08-08 23:08:31

program FontTest;
const
fontname = 'Tahoma';
size = 16;
bold = false;
italic = false;
underline = false;
strikethrough = false;
var
font, bitmap, sizex, sizey: integer;
begin
//Load the font into memory
font := LoadCharsFromFont2(fontname, size, bold, italic, underline, strikethrough);

//Generate a bitmap mask from the previously loaded font
bitmap := CreateBitmapMaskFromText('Hello', font);

//Display the font in the debug window
GetBitmapSize(bitmap, sizex, sizey);
DisplayDebugImgWindow(sizex, sizey);
CopyCanvas(GetBitmapCanvas(bitmap), GetDebugCanvas, 0, 0, sizex, sizey, 0, 0, sizex, sizey);
end.

shadowpwner

2007-08-09 15:24:34

Thanks for the example script, but how would I go upon using scar to search for the font on a webpage , and return what it typed in plain text on the debug window?

suppose the page had Hello World in time new roman, but it was an image. How would i go about using SCAR to identify what the text says and show it in the debug window?