← Back to team overview

kicad-developers team mailing list archive

Re: Patch: move newstroke definitions to separate .cpp file

 

--- In kicad-devel@xxxxxxxxxxxxxxx, Manveru <manveru@...> wrote:
> This patch is not ideal, as the the size of the array has to be declared in
> newstroke_font.h, because sizeof() operator is used in drawtxt.cpp.

Yes, that's true. But it's not so hard to generate some #define's, storing array size separately.

OTOH double inclusion problem is easily eliminated by construction
#ifndef NEWSTORKE_FONT_H_INCLUDED
#define NEWSTROKE_FONT_H_INCLUDED
...
#endif

> I have an idea how to modify the code to feed hashmap from array of glyphs
> we already have defined, ignoring all "F^K[KFYFY[K[", which may reduce
> amount of memory used to store glyphs in code (I am even thinking about
> compression, as text format used is very compressible), and make the code
> more objective in approach.
I can add repeated string elimination, by storing them separately as named strings.
'gap' in table is about 27 kbytes long which IMHO is small enough to now worry about its size. (Oh, i was thinking it's huge just several years ago:))
The format is not really 'text' but just using same codes as ASCII. But there are many common subglyphs which may be easily compressed.







References