SRL Archive - Help

Not assigning colours..


Brandon

2012-03-11 20:07:44

Why does it not colour the font correctly? Everything else it does but it won't colour it correctly!


{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

Function Fonts: Boolean;
var
Font: TFont;
BMP: Integer;
begin
//Font.Style = [fsBold, fsItalic, fsUnderline, fsStrikeOut];

Font:= TFont.Create;
Font.Name:= 'Courier New';
Font.Style:= [fsBold, fsItalic];
Font.Size:= 12;
Font.Color:= clRed; //This is the line.. Yet it prints white fonts -__-

if (LoadSystemFont(Font, Font.Name) = False) then
begin
Font.Free;
FreeBitmap(BMP);
RaiseException(erCustomError, 'Invalid Font Name');
end;

BMP:= BitmapFromText('Testing..', Font.Name);

DebugBitmap(BMP);
Font.Free;
FreeBitmap(BMP);
end;

begin
SetupSRL;
Fonts;
end.

bg5

2012-03-11 21:45:56

BitmapFromText is OCR function ,which makes black&white bitmap to future use in OCR:
https://github.com/MerlijnWajer/Simba/blob/master/Units/MMLCore/ocr.pas#L1206

But you can still replace clwhite with font color.
FastReplaceColor(bmp,clwhite,font.color);