freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] FreeType Amalgamation


From: Chris Morgan
Subject: Re: [ft-devel] FreeType Amalgamation
Date: Fri, 20 Jan 2012 13:25:00 -0500

On Fri, Jan 20, 2012 at 12:39 PM, Vinnie <address@hidden> wrote:
> Just wanted to chime in to say that I've been using ft on an embedded

> system for a year or more now. Went the library route so I build a
> libfreetype.a and had no trouble with this. Not really sure what the desire
> to have an amalgamation is.

The goal of an amalgamation is to make it possible for a developer to
distribute full sources for an application, while requiring no external
dependencies or added build steps.

DSP Filters Demo is an example of such an application:
http://code.google.com/p/dspfilterscpp/

You can pick up the sources and build the thing without having to download
or checkout anything else, using these lines:

unzip DSPFiltersComplete_0_9_72.zip
cd shared
g++ -o dspfiltersdemo $(find DSPFiltersDemo DSPFilters -name \*.cpp) JuceAmalgam/JuceLibraryCode*.
cpp -I JuceAmalgam -I DSPFiltersDemo/source/ -I DSPFilters/include/ $(pkg-config --cflags --libs freetype2 alsa) -ldl -lpthread -lrt -lX11 -lGL -lGLU -lXinerama -lXext

The included project files for XCode and Visual Studio allow you to build the
demo for MacOS X, iOS, Windows, and Android devices, without any
configuration or pre-build steps.

I want to add support for my Juce hinted font output. These are my sources
for producing hinted output:

http://rawmaterialsoftware.com/viewtopic.php?f=6&t=6393

If I add this code to my DSP Filters Demo, it will break the feature that
the demo requires no external dependencies. In order to compile and link
the demo with this class, it will be necessary to check out the FreeType
sources, build it for the platform, then add some platform-specific magic
words to the project, Makefile, or whatever was used to compile the demo.

On the other hand, with an amalgamation, I would be able to just add
something like FreeTypeAmalgamation.h, FreeTypeAmalgamation.cpp to my
sources, include the .h file, add the .cpp to the project (the build snippet
I gave above would automatically work with this addition) and compile
and link. Of course I would also need to embed a hinted font in my app.

The resulting demo would always look and function predictably, even if
the FreeType shared library on the target system was a different
version (because Juce performs all of its own text and graphics drawing
instead of using the system).


Could ship the libraries along with the rest of the source or require that they be available on the system. This is easy on Linux but a pain on Windows where there isn't really a package management system.

Having an amalgamated version doesn't impact me any since most of my stuff requires several external libraries. I just ship with the precompiled libraries.


 
> Wouldn't be opposed to cleaning things up to make it possible to build an
> amalgamation but from past use of sqlite it was a real pain trying to merge
> c++ code into sqlite due to the amalgamated approach.

What exactly was the issue with sqlite?

I added encryption to it which required stubbing in functions for memory or block allocation. I don't recall the specifics but it was related to the c++ compiler and including sqlite headers in c++ code I think. I got it working but it wasn't trivial to integrate the build setup.

Chris

 

reply via email to

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