← Back to team overview

kicad-developers team mailing list archive

Re: Bitmap fonts

 

On 04/14/2016 06:39 PM, Simon Richter wrote:
> Hi,
> 
> On 14.04.2016 11:33, Maciej Sumiński wrote:
> 
>> Currently, the most expensive thing to draw is stroked text, as there
>> are lots of labels on tracks and pads. To reduce the drawing cost (and
>> memory requirements), texts that are not targeted to Gerber files (i.e.
>> pad & track labels) might be displayed using bitmap fonts. This way, a
>> single letter cost is reduced from tens of triangles to just two.
> 
> Do these actually need to be stored, or can they be generated on the fly
> from some simpler representation?
> 
>    Simon

Previously they were generated on the fly for every frame. Storing them
occupied a lot of memory, so I decided to generate them only when
appropriate (i.e. they are in the current view area and the zoom level
is high enough).

Another solution that comes to my mind is some kind of
pseudo-instancing, where the stroked font lines are stored once and the
video card receives only a range of indexes to draw and a transformation
matrix to apply. That should be not that hard to introduce.

Still, it is hard to beat 2 triangles per character. I am willing to
increase the font texture atlas resolution if people are not satisfied
with the outcome.

Regards,
Orson



Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References