freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] FT_Outline_Copy


From: Scott Long
Subject: Re: [Devel] FT_Outline_Copy
Date: Tue, 24 Sep 2002 09:00:16 -0700

Hello Graham,

Well, this particular project is in C, but I do understand what you are saying. Constructors and destructors are the simplest solution, because they already know how an object needs to get cleaned up.

I've wondered before, it seems like many people want to keep Freetype in C, which I agree with for the most part. But is there any reason why we can't have a maintained C++ API to wrap it? It seems silly knowing that there are probably hundreds of people using Freetype from C++, each of whom has written their own set of wrappers. None of these wrapper classes are probably compatible with each other...

Has anyone ever discussed branching off a C++ API that just calls the C API? I'd probably be willing to help maintain such a thing, if it ever happened. And it would make a lot of people happy, and would be a good compromise that avoids having to toss the entire library.

It's a legitimate point that C++ is not as widely standardized as C, but if we just adhered to a basic coding standard we could easily target most of the modern C++ compilers (g++, Visual C++). That would penetrate for at least a large fraction of the C++ users out there. Please some of the people all of the time, all of the people some of the time, etc..

I guess another option would be to introduce constructors and destructors to Freetype, with extremely well-defined semantics about when they are supposed to be invoked. That could help at least make it easier to manage the problems of object ownership, etc. If the user constructs an object, he is responsible for destructing it. If the library constructs an object, *it* is responsible for destructing it.

Any other thoughts?

Regards,
Scott Long

On Mon, 23 Sep 2002 21:06:17 +0100
 "Graham Asher" <address@hidden> wrote:
Scott,

your criticisms of FT_Outline_Copy are really a coded plea for the
conversion of FreeType to C++ ;-)

I have long argued for this without any success at all, but I have been able to take parts of FreeType and turn them into C++, including writing a proper outline class that overcomes all the ownership problems. The proof of the pudding is in the eating, and I have been eating a far more appetising pudding, and one that is moreover easier to cook, for a while. New code
using (carefully designed) classes takes about half the time to write
compared to C. Bugs caused by object ownership or lifetime just don't
happen.

Best regards from a fellow sufferer.

Graham Asher



_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel

Scott Long
SwiftView, Inc. http://www.swiftview.com



reply via email to

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