freetype
[Top][All Lists]
Advanced

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

Re: [ft] optimize executable size


From: mpsuzuki
Subject: Re: [ft] optimize executable size
Date: Fri, 19 Sep 2008 17:36:18 +0900

Hi,

On Fri, 19 Sep 2008 09:52:44 +0200
>> Maybe if you can clarify the required feature and
>> the expected code size, some people may help you.
>>   
>We want use micro-controller 8 or 16 bits and we are searching a method 
>to draw character easily with many different size, but the code must be 
>very small and very fast to execute (else we will use bitmap)

Umm, I don't have the developer environment for
micro-controllers in my hand.

# If anybody knows good free toolchains and the
# emulators for experiments, please let me know.
# I've checked SDCC packages distributed in Debian,
# it's interesting but they have no file systems,
# so it's difficult to do straight experiments.

>> 2. current binary size (if possible, publishing
>>    the binary of libfreetype.a you built on some
>>    web page), and how much you want to reduce.
>>   
>I upload it on http://fx.gendrin.free.fr/freetype/, and I wish to reduce 
>around 50ko (less if possible).

Thank you. I've checked the binary. It's i386 binary,
if possible, please let me know the size of libfreetype.a
compiled for your target micro-controllers.

Checking the content of your libfreetype.a, it seems
that almost unrequired modules (e.g. BDF, PCF, PFR etc)
are already removed. Good. If I strip the symbol tables
from libfreetype.a, still it size is 160kB. Still 3 times
larger than your request.

Checking the sizes of each object files in libfreetype.a,
truetype.o, sfnt.o and ftbase.o are the top 3. One of
them spends about 50kB. I think indepth surgery of the
source code is required for further size reduction.
I've never tried such, following is just idea in the air.

truetype.o:
        Really I don't have idea to reduce the size.

sfnt.o:
        Maybe you don't need some TrueType tables
        (e.g. PCLT). Also the parsers for hi-end
        cmap formats supporting UCS4 or Variation
        Selectors are not required. I guess the
        routines related with name table can be
        omitted, but I cannot expect the side effect
        of the removal of name table parser.
        If you can restrict the bitmap table format,
        you can reduce the size.

ftbase.o:
        By removal of the routines working as a
        fallback for MacOS specific font formats,
        you can reduce the size. I remember there
        was a macro to disable them, I will check,
        please wait.

Nothing to say, removing the functions by the editor
is not enough. The dependency should be resolved.
You will have to make a call graph which functions
are used in your system.

Anyway, I'm quite suspicious if such surgery can
reduce the size of binary less than 50kB. Is it
impossible to restrict the font to outline only,
or bitmap only?

Regards,
mpsuzuki




reply via email to

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