freetype-devel
[Top][All Lists]
Advanced

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

Musing about the new API


From: Pavel Kankovsky
Subject: Musing about the new API
Date: Sun, 19 Mar 2000 19:21:26 +0100 (MET)

The recent debate made me look at the new API closer...
for the first time. Of course, an immediate outburst of (hopefully
constructive) criticism was unavoidable. :)

1. Why is FT_Size called FT_Size instead of FT_SizeSlot? (It is "a
container where resolution and pointsize dependent data of a give face
can be loaded.")

2. I am afraid FT_New_Size and FT_New_GlyphSlot are next to useless. Sure,
you can create new sizes and new glyphs...err...glyph slots but unless you
use them in a strictly LIFO order (create size, create glyph slot, load
glyph, use glyph, destroy glyph slot, destroy size), you would have to
mess with FT_Face->size and FT_Face->glyph to be able to use them and that
would be very very ugly.

3. Things like FT_GlyphSlot->next should not be exposed to the user.
(Supplementary question: why do sizes have their FT_Face->sizes_list and
glyph slots do not?) I agree it is quite annoying to create and have to
use an access "method" for every stupid field of the structure but the
other extreme is not perfect either.

4. I find the semantics of FT_Open_Args and related functions somewhat
confusing. In particular, I am afraid that depending on the place where
FT_Open_Face fails, the stream (supplied by the user of created
automatically) is either destroyed or left alone.

5. Is it necessary to have one implementation of FT_Outline_Decompose() in
ftraster.c and another one in ftobjs.c?


Some suggestion:

ad 2.+4. I think "the convenience layer" of the API should be clearly
separated from the rest of the library and its operations should be built 
on the top of "general-purpose" operations.

ad 3. Ideally, private fields should be hidden in the same way
driver-specific fields are hidden. Or at least, such fields should be
moved to the end of their struct's not to break binary compatibility when
they change (and marked as private clearly).


--Pavel Kankovsky aka Peak  [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."




reply via email to

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