Recent

Author Topic: New version of BGRABitmap  (Read 284699 times)

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #360 on: April 26, 2018, 06:47:39 pm »
True.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #361 on: May 17, 2018, 08:29:10 pm »
New version of BGRABitmap 9.7 :

    added TextFitInfo that returns the number of char within a certain width
    added Bidi support i.e. right-to-left writing and a mix of LTR and RTL : the property FontBidiMode specifies how to handle base direction and it can be overriden by RightToLeft parameters
    added support for remaining TTextStyle options : ShowPrefix, EndEllipsis, RightToLeft
    fixed a bug with clipping and TextRect
    improvements on GIF editing, support for loop count
    faster loading of flat ORA and GIF
    added support for layered LZP
    improvement on TIFF reader (faster, support more files)
    fixed color for BMP 32 bit on Linux
    fix for gradients having one end being fully transparent

added text measurement functions for wordwrap:
Code: Delphi  [Select][+][-]
  1.     function TextSize(sUTF8: string; AMaxWidth: integer): TSize; override;
  2.     function TextSize(sUTF8: string; AMaxWidth: integer; ARightToLeft: boolean): TSize; override;
  3.     function TextFitInfo(sUTF8: string; AMaxWidth: integer): integer; override;  

https://github.com/bgrabitmap/bgrabitmap/releases

Here is a test program to check bidi support.

Upgrade note: before, the Linux version guess text orientation and Windows version assumed left-to-right. The new version by default guess text orientation but you can change it by setting TBGRABitmap.FontBidiMode to fbmLeftToRight to have the same result on Windows as before. Also you can add a parameter RightToLeft to text functions to override FontBidiMode for a specific call.

Other note: Bidi support works only for the LCL text renderer (the one used by default). It does not apply to TBGRAFreeTypeFontRenderer (used with NoGUI) nor TBGRAVectorizedFontRenderer (used with Canvas2d).

Regards
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #362 on: May 18, 2018, 07:19:44 pm »
Sorry but I forgot to merge the dev branch into the master branch. Now its done.

Correct version is 9.7.2.
« Last Edit: May 18, 2018, 10:42:57 pm by circular »
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #363 on: May 18, 2018, 11:46:45 pm »
Thanks. The other day I released about 5 versions of the same app, all fixing the previous. Is a hard thing to learn, releasing..., and do it alone, or with a small team...
« Last Edit: May 18, 2018, 11:49:54 pm by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #364 on: May 19, 2018, 10:33:21 am »
Indeed. It is a bit embarrassing. But the best way to avoid mistakes is to stop doing things.

But we are improving the release process. Thanks to online package manager, the problem of forgetting to merge the branch will not happen again as I can simply check the version number on it. If I change the JSON file at the same time as the package version, if it is merged it will be updated on OPM otherwise it will not.

Now for bugs, compiling issues, etc. the only way is testing and it takes as much time to test than to code. So it is a difficult choice: do we make our users wait longer for new features or do we make more releases?

As you mention we are working alone most of the time.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #365 on: May 19, 2018, 10:45:09 am »
By the way, Gilles Vasseur has made a component for image transition thats looks cool:
https://www.youtube.com/watch?v=bJeGVjZtHKk

Here is his blog (in French): https://www.developpez.net/forums/blogs/600183-gvasseur58/

 8-)
Conscience is the debugger of the mind

gillou58

  • New member
  • *
  • Posts: 9
Re: New version of BGRABitmap
« Reply #366 on: May 19, 2018, 11:49:04 am »
Thanks circular for your great job   ;)

As you have reported, I have made a component with your BGRABitmap library to show pictures with transitions and special effects. The link you mentioned is for my blog but it is in French. I suggest to people that are interested in this work to read tutorials : there are in French too but you have a button for the Microsoft Translator in the upper left corner of each tutorial.
Only the first one in on line. The following ones will come as soon as possible...

The source code of the component will be soon released too.

Link to the first tutorial :
https://gilles-vasseur.developpez.com/tutoriels/transitions/bgra1/

Link to a video on Youtube to see the component in action :
https://www.youtube.com/watch?v=bJeGVjZtHKk&lc=z22tv5cxykfcifimyacdp435bjytzoio3cxzznk0bl1w03c010c

Gilles

lainz

  • Hero Member
  • *****
  • Posts: 4449
    • https://lainz.github.io/
Re: New version of BGRABitmap
« Reply #367 on: May 19, 2018, 04:30:21 pm »
Beautiful component  :)

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: New version of BGRABitmap
« Reply #368 on: May 19, 2018, 09:44:03 pm »
Hello,
Thanks Circular for your BGRABitmap library ! I learned pascal language in the 80s, only procedural programming. Then a long break ... I discovered object-oriented programming by discovering the nice Lazarus project, 7 years ago.
Quickly I came across your library and I was surprised to see everything I could do so easily with BGRABitmap !
So I looked at your code a bit and learned a lot about the concept of 'framework'. I still have a lot to learn !
I appreciate because the code is robust, reliable and always easy to use.
Thanks for your work !  :)
wishing you a nice life

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #369 on: May 19, 2018, 11:31:11 pm »
Lulu, I am pleased to learn about your journey with Pascal and that I somehow contributed to it. I remember when I learned this language by looking at existing programs. I am happy to achieve my aim to provide something easy to use.  :)
Conscience is the debugger of the mind

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: New version of BGRABitmap
« Reply #370 on: May 20, 2018, 10:17:27 pm »
Hello,
It seems that TBGRATextEffectFontRenderer no longer draws the outline of the text. The issue appears after BGRABitmap update to 9.7.2.0 with OPM.
Below is a small project that reproduces the problem.
wishing you a nice life

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #371 on: May 21, 2018, 10:47:34 am »
Oh I see. Thanks for reporting. I have fixed it in version 9.7.3:

https://github.com/bgrabitmap/bgrabitmap/releases
Conscience is the debugger of the mind

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: New version of BGRABitmap
« Reply #372 on: May 21, 2018, 08:15:17 pm »
after updated to 9.7.3 with OPM, I got compile error, see attachment below
wishing you a nice life

circular

  • Hero Member
  • *****
  • Posts: 4181
    • Personal webpage
Re: New version of BGRABitmap
« Reply #373 on: May 21, 2018, 08:53:03 pm »
Hmmm... something with overloads I suppose.

Does it help to add overload after the override keyword in the definition of TextOut in TBGRAVectorizedFontRenderer in BGRAVectorize:
Code: Delphi  [Select][+][-]
  1.     procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; texture: IBGRAScanner; align: TAlignment); override; overload;
  2.     procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; s: string; c: TBGRAPixel; align: TAlignment); override; overload;
  3.  

?
Conscience is the debugger of the mind

Lulu

  • Full Member
  • ***
  • Posts: 226
Re: New version of BGRABitmap
« Reply #374 on: May 21, 2018, 09:01:48 pm »
yes it work fine now !
wishing you a nice life

 

TinyPortal © 2005-2018