freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Export services?


From: David Turner
Subject: Re: [ft-devel] Export services?
Date: Fri, 14 Oct 2005 22:11:21 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Hi everyone,

"services" are an _implementation_ detail of FreeType 2. They're not
strictly necessary since you could provide the same thing with a lot
of #ifdef in a monolithic engine. I just find them more convenient
to structure the engine.

the "wrapper" functions are here to protect the users of the service's
implementation details. They have various advantages:

- they expose a "clean" API that doesn't depend on internals of
 the font engine. Allowing us to redesign services when needed

- services can be used either internally or to implement a public
 API.

in other words, exposing services publicly has many problems:

- it forces us to expose more internals of the font engine, which
 means less possibilities for improvements in the future. And
 it's not like we've not been burned by this already
 (i.e. FT_OPTIMIZE_MEMORY breaks rogue libraries)

- it forces us to add a way to distinguish between "internal"
 and "public" services.

And I don't see how they could make the engine "more powerful".

Regards,

- David Turner
- The FreeType Project  (www.freetype.org)




Chia-I Wu a écrit :

Hi,

There are some functions which are wrappers to services.  Then why not
simply export the services to clients?

The idea is, we let modules decide which services, among those they
provide, to export.  For a exported service, it should provide headers,
not depending on internal headers, to describe the interface.  Of course
error-checking should be done with more care in this case.  To make
finding a serviou ce faster, we can use integers as service id, instead of
strings.

These are what I can think of now.  Surely there are more things we
should pay attention to when exporting services, but it also means
freetype can get more powerful.

services are an _implementation_ detail of FreeType 2, yand masking them from the user
is a good thing, because it allows us to





reply via email to

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