← Back to team overview

kicad-developers team mailing list archive

Re: Bitmap fonts

 

Hi Mario,

On 04/14/2016 12:00 PM, Mário Luzeiro wrote:
> Hi Orson,
> 
> If I understand correctly that would be the font for non board items. 

That is right. As labels are not stored in Gerber files, it is save to
use any kind of font to display them. Contrary, board items should apply
to WYSIWYG rule.

> Textures fonts are a good fast way of implement fonts.
> But it may suffer from scaling issues, as we can see in your screenshots in the very small size (they are not render properly, C2: pin 1.. etc)
> So you may need to pre-render the font in difference sizes (to different textures) to be used the appropriate one in the final render.

The same problem applies to the original, stroked font - the net label
is just very small. But I like your idea, mipmapping could enhance the
result.

> I do believe it should be possible to also cache the board text (comments, silk..etc) but I believe that will be more challenged...
> (this may need different hierarchically caches.. and complexity raise)

True. For the moment I hope the overall performance is enough for
complex boards, so we do not have to think about more entangled solutions.

Regards,
Orson

> Keep good work!
> Mario Luzeiro
> ________________________________________
> From: Kicad-developers [kicad-developers-bounces+mrluzeiro=ua.pt@xxxxxxxxxxxxxxxxxxx] on behalf of Maciej Sumiński [maciej.suminski@xxxxxxx]
> Sent: 14 April 2016 10:33
> To: KiCad Developers
> Subject: [Kicad-developers] Bitmap fonts
> 
> Hi,
> 
> As recently Jean-Pierre has reported he had been running out of memory
> with complex boards, I decided to take another step to reduce memory
> footprint of OpenGL canvas.
> 
> 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.
> 
> Another gain is we can select any font for this purpose and easily
> change it. I picked one for testing, but I think we have to decide
> together which one shall be used. Bitmap fonts are also antialiased (I
> am sorry Lorenzo), so they might be a bit easier on eyes.
> 
> As texts now do not occupy as much memory space as they used to, they
> might be stored in the video card memory. Thanks to that, they might be
> displayed on selected items as well (in the past selected items had
> labels removed). This should also reduce per-frame traffic and make
> rendering process smoother.
> 
> I did my best to use the same character set as is available with the
> original stroke font, but I wonder if it is really necessary. It seems
> that net/pad names are limited to latin characters, so maybe we should
> limit the character set. Thoughts?
> 
> At the moment bitmap fonts are only available in OpenGL canvas, as I
> believe they offer the greatest performance boost there. I am not sure
> if Cairo can really benefit from such solution, but it might be tested
> as well.
> 
> Before I push the changes to the master repository, I will be grateful
> for some testing [1] and feedback. There are also two screenshots [2, 3]
> to demonstrate the difference.
> 
> Regards,
> Orson
> 
> 1. https://github.com/orsonmmz/kicad-source-mirror/tree/bitmap_fonts
> 2. https://orson.net.pl/pub/original_font.png
> 3. https://orson.net.pl/pub/bitmap_font.png
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References