Hi,Try to contact Graeme directly:
Just for note, I`m actively working on fpGUI base on BGRABitma.
After some day of starting, Today just checked for memory usage and comparing it with fpGUI with native canvas!
WOW :o on any invalidating of form, memory increase a lot(about 0.5 MB).
And also I have a problem already, That App hangs on close!
Today I find out why! 8-)
On the EasyLazFreeType(Managing glyphs for drawing Text independently :-X) unit any glyph will add to the AVL_Tree every time! Because of the developer of this Component forgot to set OnCompare of the TAvlTree. This event enables AVLTree to compare and put the new Item on the right position on the tree, So after FindGlyph will work.
I did it, Memory loading gone, Hangs on close gone 8-)...
My Changes:
// ~/lazarus/components/lazutils/easylazfreetype.pas line1441 constructor TFreeTypeFont.Create; begin EnsureFreeTypeInitialized; FFaceLoaded := false; FFaceItem := nil; FInstanceCreated := false; FCharmapOk := false; FPointSize := 10; FDPI := 96; FGlyphTable := TAvlTree.Create; FGlyphTable.OnCompare := @GlyphTableOnCompare; //What need it is...
And the GlyphTableOnCompare function:
function GlyphTableOnCompare(Item1, Item2: Pointer): Integer; begin if TFreeTypeGlyph(Item1).Index = TFreeTypeGlyph(Item2).Index then Result := 0 else if TFreeTypeGlyph(Item1).Index > TFreeTypeGlyph(Item2).Index then Result := 1 else if TFreeTypeGlyph(Item1).Index < TFreeTypeGlyph(Item2).Index then Result := -1; end;
I did it, But for my knowledge, How I can report these kinds of [improvment/currections]?
How I can report these kinds of [improvment/currections]?You should report it in the bugtracker:
Try to contact Graeme directly:This problem is in "lazutils" package, not fpGui.
I am sorry, I missed that detail.How I can report these kinds of [improvment/currections]?You should report it in the bugtracker:
http://bugs.freepascal.org/ (http://bugs.freepascal.org/)Try to contact Graeme directly:This problem is in "lazutils" package, not fpGui.
How quaint that just happen to be missing, considering there was already an OnCompare event built into it.
I just find it HARDDDDDDDDDDDDDDD to believe!
>:D
Is there a simple way to reproduce the problem in EasyLazFreeType without using fpGUI or BGRABitmap?Sorry, Currently I don't know any way to use EasyLazFreeType, Except you mentioned.
Is there a simple way to reproduce the problem in EasyLazFreeType without using fpGUI or BGRABitmap?I did not look into the details of this discussion, but I think the problem should be seen also with TAChart in the demo "savedemo" (folder "components/tachart/demo/save" of the standard Lazarus installation) after clicking on "Save as SVG" because the SVGDrawer uses LazFreeType. This demo requires only a standard Lazarus installation.
Is there a simple way to reproduce the problem in EasyLazFreeType without using fpGUI or BGRABitmap?I did not look into the details of this discussion, but I think the problem should be seen also with TAChart in the demo "savedemo" (folder "components/tachart/demo/save" of the standard Lazarus installation) after clicking on "Save as SVG" because the SVGDrawer uses LazFreeType. This demo requires only a standard Lazarus installation.
ϻαϻɾΣɀО, can you verify that this bug occurs in this demo, too?
It`s Seems you guys look in the wrong example, Just try lazfreetypetest example located in "/lazarus/examples/lazfreetype".OK - please note this in the bug report. You cannot expect a developer to install any third party libraries in order to see a bug. That's the background of Juha's request. Always provide a demo (as simple as possible) to show the bug.
Here the ../tachart/demo/save example produces good .bmp, .png, .jpg and clipboard copies, but bombs with an error when attempting the .svg save.There has been a recent discussion about this (I don't want to search myself, sorry). The essence was that there seem to be some fonts around which cannot be read correctly by EasyFreeType. This particular exception is caught in the demo and appears only in the debugger, not outside the IDE:
For start, you must run it with three font name as parameters!What parameters should I use in a Linux system? The program always complains whatever I feed it. Not a good demo program IMO.
What parameters should I use in a Linux system? The program always complains whatever I feed it. Not a good demo program IMO.If you are in the correct example project, The "LazFreeTypeTest"
Maybe a stupid question but how does the OnCompare handler help with memory consumption?
FGlyphTable.OnCompare := @GlyphTableOnCompare;
Thanks for finding that bug. That's probably my mistake as I wrote this unit.
I remember reading that the AVL tree was buggy so that it was the reason it was acting strangely. Well at least there was some error on my side.
Note: I don't have access to the code so please file a bug report.
OK - please note this in the bug report.
You cannot expect a developer to install any third party libraries in order to see a bug. That's the background of Juha's request. Always provide a demo (as simple as possible) to show the bug.I don't expect them to do that!
Reported as https://bugs.freepascal.org/view.php?id=35627 (https://bugs.freepascal.org/view.php?id=35627).Please test.
Testd, And problem solved. Thanks.Reported as https://bugs.freepascal.org/view.php?id=35627 (https://bugs.freepascal.org/view.php?id=35627).Please test.
But what did you mean by "Widgetset should not be CustomDrawn but it cannot be removed for some reason."The issue was about LazUtils package which has nothing to do with LCL or its widgetsets.
As I know I'm just developing theme/style or whatever fpGUI call it the way they did it. Is that what you mentioned "Widgetset"?
"cannot be removed for some reason" What?It cannot be removed from the bug report. There is no way to deselect it.
Beautiful work you did there. :)Thakns Alot.
Happy you like the font rendering of LazFreeType and BGRABitmap.It's my pleasure.
I am wondering for what purpose you need minibidi as bidi is now handled by BGRABitmap?I read that code, It seems too heavy, I like what the minibidi did, Light and applicable.
How do you get the ligatures?Thats about minibidi, he "Zaher Dirkey" did it but it's not complete yet, I will do it.
So minibidi replaces with ligatured glyphs. So I suppose there are Unicode characters that represent the ligature?Yes, it dose. Unicode characters of course. But no fully implementation!
So implementing bidi and ligatures in TFreeTypeFont could interfere with minibidi?I think yes!
By the way is there a link to your code?May be, I will check is there a space on my website's host!
I am wondering for what purpose you need minibidi as bidi is now handled by BGRABitmap?I read that code, It seems too heavy, I like what the minibidi did, Light and applicable.
But I have got a plan to speed up that, All of Shapetaypes will be cached into memory, About 192KB of ram instead of a quick search of shapetype for every charachter!
Hello .ϻαϻɾΣɀО …
BGRATextBidi ???