Recent

Author Topic: TBGRABitmap + NoGUI  (Read 24850 times)

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TBGRABitmap + NoGUI
« Reply #15 on: January 29, 2013, 09:58:13 pm »
Try to disable axis marks:
Code: [Select]
  chart.LeftAxis.Marks.Visible := false;
  chart.BottomAxis.Marks.Visible := false;

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #16 on: January 29, 2013, 10:05:24 pm »
Oh yeah, it works fine now! :)

There are a prevision to implement support for text? I will create a layer to generate PDF reports, and probably the part of charts will be generated with BGRABitmap.

Thank you for the great help, I'm very happy with BGRABitmap! :)
« Last Edit: January 29, 2013, 10:07:37 pm by silvioprog »

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #17 on: January 29, 2013, 10:20:04 pm »
Cool.

I've updated BGRABitmap again to avoid crash if text functions are used.

About text functions, there is a basic support for FreeType : TBGRAFreeTypeDrawer in unit BGRAFreeType.
« Last Edit: January 29, 2013, 10:30:54 pm by circular »
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #18 on: January 29, 2013, 10:29:45 pm »
Nice job. :)

Now, it show this:

Code: [Select]
C:\Users\silvioprog\Desktop\nogui_bgra>noguidemo.exe
TRasterImage.BitmapHandleNeeded: Unable to create handles, using default

C:\Users\silvioprog\Desktop\nogui_bgra>

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #19 on: January 29, 2013, 10:31:22 pm »
FreeType implementation is a little bit buggy (some fonts cannot be loaded, extended characters are mixed up) and it cannot be used to draw text with angle. Moreover it is necessary to supply some font files. So it's not very straightforward to switch to FreeType, hence the necessity of the explicit use of BGRAFreeType unit.

Oh, so maybe this message appears when TBitmap.Create is called ?
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #20 on: January 29, 2013, 10:42:15 pm »
> FreeType implementation is a little bit buggy (some fonts cannot be loaded, extended characters are mixed > up) and it cannot be used to draw text with angle. ...

Hm... The old demo print text with angle:

https://www.dropbox.com/s/rm7fuv265f9wdfv/nogui.zip (changed from original demo: \lazarus\components\tachart\demo\nogui).

> Oh, so maybe this message appears when TBitmap.Create is called ?

I'll debug it ...

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #21 on: January 29, 2013, 11:49:59 pm »
> FreeType implementation is a little bit buggy (some fonts cannot be loaded, extended characters are mixed > up) and it cannot be used to draw text with angle. ...

Hm... The old demo print text with angle:

https://www.dropbox.com/s/rm7fuv265f9wdfv/nogui.zip (changed from original demo: \lazarus\components\tachart\demo\nogui).
Yes, but that's using the FreeType dll. BGRABitmap use integrated FreeType (EasyLazFreeType unit).

Quote
> Oh, so maybe this message appears when TBitmap.Create is called ?

I'll debug it ...
I suppose. But I don't know how to check if LCL is in nogui mode without "trying" it.
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #22 on: January 30, 2013, 02:35:37 am »
> Yes, but that's using the FreeType dll. BGRABitmap use integrated FreeType (EasyLazFreeType unit).

Hm... but can you use FreeType dll? :/

> I suppose. But I don't know how to check if LCL is in nogui mode without "trying" it.

Sorry for my delay buddy:

Code: [Select]
program project1;

{$mode objfpc}{$H+}

uses
  Interfaces,
  InterfaceBase;

begin
  case WidgetSet.LCLPlatform of
    lpNoGUI: WriteLn('Oh, is NoGUI! :S');
  else
    WriteLn('Other sexy widget ;)');
  end;
end.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: TBGRABitmap + NoGUI
« Reply #23 on: January 30, 2013, 04:04:25 am »
I have actually considered adding LazFreeType support to TAChart for nogui, BGRA and perhaps even TCanvas drawers (because LazFreeType should, in theory, provide exactly identical font rendering on all platforms, as opposed to TCanvas).
However, if I understood correctly, work on LazFreeType is stalled now?

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #24 on: January 30, 2013, 11:24:31 am »
Thanks silvioprog.

Well to my knowledge, I'm the only person who worked on LazFreeType and I had other priorities.

The main thing that need to be solved is the correct handling of extended chars. And it is not possible to apply an orientation yet.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #25 on: January 30, 2013, 12:00:17 pm »
I've updated BGRABitmap (on subversion) to work with vectorized fonts. To use this, you need to have glyphs files and to define the font renderer of some TBGRABitmap :
Code: [Select]
uses BGRAVectorize;
...

img.FontRenderer := TBGRAVectorizedFontRenderer.Create('.');
(here glyphs are loaded from the current directory)

Here is the chart test. And the Png looks like this :
« Last Edit: January 30, 2013, 12:06:47 pm by circular »
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #26 on: January 30, 2013, 01:27:03 pm »
Great job friend! :)

Which tool used for edit files "*.glyphs"?

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #27 on: January 30, 2013, 02:16:56 pm »
There are saved from TBGRAVectorizedFont. See project2 in fontrenderer.zip here :
http://www.lazarus.freepascal.org/index.php/topic,12390.msg112670.html#msg112670
Conscience is the debugger of the mind

Silvio Clécio

  • Guest
Re: TBGRABitmap + NoGUI
« Reply #28 on: January 30, 2013, 02:48:57 pm »
Thank very much buddy, I'll test it in Linux too.

I got a error. Change your demo to:

Code: [Select]
chart.LeftAxis.Marks.LabelFont.Size := 30;
It generating this chart:

http://imagebin.org/244800

How to fill the font color?

circular

  • Hero Member
  • *****
  • Posts: 3442
    • Personal webpage
Re: TBGRABitmap + NoGUI
« Reply #29 on: January 30, 2013, 02:52:54 pm »
Which error do you get? It works if you get an image, no?

Are you talking about the fact that the letters appear in white ? I suppose it's a PNG issue. Try with another file format.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018