Recent

Author Topic: Text Rendering to Canvas is very slow on MacOS and Linux  (Read 4482 times)

Superdisk

  • Jr. Member
  • **
  • Posts: 73
Re: Text Rendering to Canvas is very slow on MacOS and Linux
« Reply #15 on: December 26, 2020, 01:14:42 am »
I checked out the demo on LMDE 4 Linux and macOS Mojave 10.14, both in a VM on Win 10 host, and do no noticable delay on this Linux and a slight slowness on mac (which is maybe due to the VM) when dragging the violet rectangle.

Tried to enter some text into the grid, but this was not successful at all although the font was installed. Is this how it is supposed to be?

Thanks for trying out the program-- The grid is divided into columns where letters can be typed into the first sub-column, numbers in the second, and hex values in the fourth and fifth.

Is there any chance you could record a video of your interaction with the rectangle so I can see the latency?

Thanks!!

circular

  • Hero Member
  • *****
  • Posts: 4469
    • Personal webpage
Re: Text Rendering to Canvas is very slow on MacOS and Linux
« Reply #16 on: December 26, 2020, 02:56:58 am »
Cool, this may be just what I need... Ideally I'd like to use the OS's capabilities as much as possible, including for font rendering but this looks promising in the meantime :)

Thanks.
You're welcome.  :)

The other alternative I see is to precompute the image of characters. If it is just a subset, then that is easy to do. A more generic approach is to split the text into groups. For example TGlyphCursorUtf8:
https://github.com/bgrabitmap/bgrabitmap/blob/master/bgrabitmap/bgrautf8.pas
Conscience is the debugger of the mind

wp

  • Hero Member
  • *****
  • Posts: 13423
Re: Text Rendering to Canvas is very slow on MacOS and Linux
« Reply #17 on: December 26, 2020, 05:17:21 pm »
These are the screen capture videos, stored as animated gif. You'll see that your demo has the same speed in Win10 and Linux (LMDE4), and is a bit slower in macOS, the latter probably because my virtual mac is generally rather slow.

P.S.
Had to upload Linux and macOS gifs separately due to forum file size limit
« Last Edit: December 26, 2020, 05:20:36 pm by wp »

wp

  • Hero Member
  • *****
  • Posts: 13423
Re: Text Rendering to Canvas is very slow on MacOS and Linux
« Reply #18 on: December 26, 2020, 05:19:18 pm »
Separate upload due to forum file size limit

wp

  • Hero Member
  • *****
  • Posts: 13423
Re: Text Rendering to Canvas is very slow on MacOS and Linux
« Reply #19 on: December 26, 2020, 05:19:46 pm »
Separate upload due to forum file size limit

 

TinyPortal © 2005-2018