← Back to team overview

kicad-developers team mailing list archive

Re: Bitmap fonts

 

Le 15/04/2016 11:21, Maciej Sumiński a écrit :
> 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

Orson,

I just tested your last version, and I find the result rather good.

Only one thing: I have some trouble to understand the criteria used to decide if pad numbers and net
names are shown or not:
For a given pad (i.e. font size), it depends not only on the zoom level (this is what I was
expecting), but also on other things like the fact you are zooming from high level to low level or
the opposite, and the board area shown on screen.

Thanks.


-- 
Jean-Pierre CHARRAS


Follow ups

References