freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to calculate the size of FT_RENDER_POOL for 240x320 LCD


From: Alexei Podtelezhnikov
Subject: Re: How to calculate the size of FT_RENDER_POOL for 240x320 LCD
Date: Tue, 20 Dec 2022 22:13:46 -0500

On Tue, Dec 20, 2022 at 9:11 PM ricky rocky <rickyrocky.ble@gmail.com> wrote:
> #define FT_RENDER_POOL_SIZE  16384L
>
> This definition is used in smooth/ftgrays.c/gray_convert_glyph() as a local 
> buffer.
> For my small RAM chip, it is the large size.

You cannot spare 16kB for rendering. Alrighty. Or, do you want to
allocate it elsewhere, not on stack?

> For 240x320 LCD, Could I reduce this size? and how much is good?

What is the text pixel size that you need? Very roughly, the number of
nontrivial pixels is 8x the pixel size, if your font is not too fancy.
Each gray pixel is 16 bytes on 32 bit architectures, more on 64 bits.

For example, for 20 pixels per EM, you can probably get away with 2kB.
You can use even less, but you will pay with performance.

I would like to suggest doubling to pool because 32kB is reasonable these days.

Alexei



reply via email to

[Prev in Thread] Current Thread [Next in Thread]