Results 1 to 2 of 2

Thread: Not assigning colours..

  1. #1
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default Not assigning colours..

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

    Simba Code:
    {$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.

  2. #2
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

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

    But you can still replace clwhite with font color.
    Simba Code:
    FastReplaceColor(bmp,clwhite,font.color);
    Last edited by bg5; 03-12-2012 at 01:48 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •