freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] proposal to introduce ftbase.h in src/base directory


From: mpsuzuki
Subject: [ft-devel] proposal to introduce ftbase.h in src/base directory
Date: Wed, 1 Oct 2008 11:45:50 +0900

Dear Sirs,

I want to introduce new header file in src/base/ftbase.h,
to declare the private functions shared by the files
in src/base directory. I want to hear the comments
from FreeType2 developers.

--

During the working for the 1st phase of sfnt-wrapped
Type1 PS and CID-keyed font support, I wanted to use
a few exactly same functions in ftobjs.c (for the platform
without Apple's Carbon framework) and in ftmac.c (for
the platform with Apple's Carbon framework). At present,
there are 2 reasons to duplicate the same functions
in 2 source files.

R1: These functions are internal utilities.

The typical example of duplicated functions is 
open_face_from_buffer(), which is designed to open
a face from memory image (instead of the FT_Stream
object based on memory image). It is a thin wrapper
of FT_Stream_OpenMemory() & FT_Open_Face(), which
is used to simplify the source code. Such functions
are only designed for internal use of a single source
code - putting such functions to another file makes
worse the readability of source code.

R2: These functions should be hidden by apinames.

Today, the binary compatibilities with FreeType2
binary is very very important. Even if the internal
functions are not explicitly declared in the public
header files, the private functions should be hidden
by apinames as many as possible, to avoid the
"unresolved function" troubles in dynamic linking.

I'm planning a migration from Carbon-dependent
ftmac.c to Carbon-free ftobjs.c. It is impossible
to migrate all features, but the most important
feature, suitcase font support should be migrated.
I want to change ftmac.c in step-by-step for
smooth migration, so I want to share some utility
functions between ftobjs.c and ftmac.c. My request
conflicts with R1. But I don't want to conflict
with R2.

If I register the utility functions with FT_LOCAL_DEF()
in include/freetype/ftobjs.h, the declarations
would be imported to other source files using FT_Stream,
so it's not good idea (we receive many warning in the
compilation of the source code including ftobjs.h but
does not include ftobjs.c as "function XXX is declared
as static but not written anywhere").

So, I want to introduce ftbase.h in src/base/, to
declare the functions shared in the source files in
src/base (e.g. ftobjs.c and ftmac.c).

Please give me the comments.

Regards,
mpsuzuki




reply via email to

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