bgrabitmap / bgrabitmap

📜 BGRABitmap graphics library made with Lazarus (Free Pascal).
https://bgrabitmap.github.io/
202 stars 33 forks source link

Dependencies to Lazarus #139

Closed fredvs closed 2 years ago

fredvs commented 3 years ago

Hello.

When compiling a console or msegui application, bgrabitmap needs files from /lazarus/components/lazutils/.

Could it be possible to consider to add in bgrabitmap directory the files needed to not oblige people to install all Lazarus ?

In attachment the files needed.

lazdep.zip

circular17 commented 3 years ago

That's a good point

circular17 commented 2 years ago

Related to https://github.com/bgrabitmap/bgrabitmap/issues/168

Now there is only a dependency to freetypelaz and FCL.

Actually you don't need to download all Lazarus. You can just get the following directory: https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/components/freetype

rchastain commented 1 year ago

Actually you don't need to download all Lazarus. You can just get the following directory: https://gitlab.com/freepascal.org/lazarus/lazarus/-/tree/main/components/freetype

I believe you also need components/lazutils, otherwise you get this error:

Compiling /home/roland/Documents/pascal/sources/bgrabitmap-11.5.4/bgrabitmap/bgrafreetype.pas
Compiling /home/roland/lazarus-trunk-2023-04-19/lazarus/components/freetype/easylazfreetype.pas
easylazfreetype.pas(22,31) Fatal: Can't find unit Laz_AVL_Tree used by EasyLazFreeType
circular17 commented 1 year ago

LazUtils is still needed for FreeType implementation.

circular17 commented 1 year ago

I've made a BGRABitmap4NoLCL package that doesn't use any of the LCL.

Note that it does not have font rendering (no system rendering, no FreeType rendering). You can have the same result by applying -dBGRABITMAP_DONT_USE_LAZFREETYPE compiler option.

fredvs commented 1 year ago

MSEgui has his own font rendering, including unicode and freefonts.

Maybe use this instead of font rendering from Lazarus? I will check in BGRAUTF8 maybe it could be done easy when msegui was assigned...

circular17 commented 1 year ago

Well yes in fact in MSEgui you may render with the system using what's provided my MSEgui. So maybe you don't need FreeType at all.

fredvs commented 1 year ago

In what case is lazutf8 used?

In the msegui demo _FractalTree that you provided in BGABitmap/test/, it uses bmp.TextOut() and the rendering is perfect, even for Chineese chars. https://github.com/bgrabitmap/bgrabitmap/blob/master/test/test4ideu/fractal_tree/main.pas

Is lazutf8 needed there?

circular17 commented 1 year ago

I suppose it is not needed as it was necessary for FreeType which is not used anymore

fredvs commented 1 year ago

Tested msegui /test/fractal_tree from last BGRABitmap release. Without any lazutf8.pas added nor path to directory to lazutils.

Perfect, compiles without cry and nice font-rendering.

testbgramsegui

Trick: for not latin-root font in Linux, use a universal font, like Unifont: bmp.FontName := 'Unifont';

testbgramseguichineese

Also try to compile StrumPract, deleting all lazutf8 dependencies. The same, compiles without tears, and nice rendering.

So good to feel free! ;-)

Well done and many thanks.

fredvs commented 1 year ago

Hello.

Very little detail.

When using the _fractaltree.prj project file given in: https://github.com/bgrabitmap/bgrabitmap/tree/master/test/test4ideu/fractal_tree

there could be problem for user at compilation: https://github.com/mse-org/mseide-msegui/discussions/55#discussioncomment-5955926

This because when using some {$ ifdef ...} fpc ignore it without using the -B (rebuild all) parameter.

In attachment, the fractal_tree.prj file with -B option added. Also the color of warning and error messages were inversed, it is fixed in the attachment.

It would be great if you could replace the fractal_tree.prj so people will be able to compile out-of-the-box.

Thanks.

fractal_tree.prj.zip

circular17 commented 1 year ago

Ok I've applied the change on dev branch

fredvs commented 1 year ago

Many thanks!

circular17 commented 1 year ago

Thank you too!