Freetype on Mac OS X?

Phil Race philip.race at oracle.com
Fri Oct 25 08:49:09 PDT 2013


You might have managed to build, but there will be some things that do 
not run
without freetype.

You could try using java.awt.Font.createFont(..) with a Postscript Type 
1 font - this
doesn't need a head if you pass in -Djava.awt.headless=true  - and I am 
99.999%
sure you'll get an unsatisfied link error or similar.

The strictures about freetype on Mac is coming from the X11 install.
No one could produce a build based on using that which is guaranteed
to work on any one else's system

Many months ago - based on someone else's work - I had a patch to allow 
you to
use a pre-built one and bundle it in the build but it was around the 
time there
was a "hold" on all build changes, and its likely stale even if could 
find it.

I also remember it was a *pain* building a freetype dylib that didn't 
bake in
the location it should be found into referencing dylibs. Can't remember if
I completely solved that.

So in summary what is needed is that people are told how to go get freetype,
build it into one that can be used anywhere, and that the build be changed
to provide a way to not always use 'system freetype' on OS X, but instead
to copy in your pre-built copy.

-phil.


On 10/25/2013 4:37 AM, Magnus Ihse Bursie wrote:
> Hi there mac porters :-)
>
> When I fiddled with the build system for using freetype in the OpenJDK 
> builds, it turned out a couple of inconsistencies regarding freetype 
> on macosx.
>
> The current build system actually requires freetype to be present when 
> building. When building libfontmanager, we include freetypeScaler.c 
> (which I think is the only consumer of freetype) and link with 
> -lfreetype, on macosx as well as on linux and solaris.
>
> However, I'm not entirely sure this is correct. Evidence (like the 
> build documentation :)) seems to indicate that freetype is not/should 
> not be used on macosx, not even for OpenJDK. (It's never used when 
> building the closed product.)
>
> I tried out a simple patch which excludes freetypeScaler.c when 
> building on macosx, and stops linking with freetype. It compiles 
> without issues, but I have no readily access to a "headful" Mac to try 
> this on, nor do I really know what tests to run to check of 
> libfontmanager works as expected.
>
> I'd appreciate some input on this.
>
> Here is the patch I used:
>
> diff --git a/makefiles/lib/Awt2dLibraries.gmk 
> b/makefiles/lib/Awt2dLibraries.gmk
> --- a/makefiles/lib/Awt2dLibraries.gmk
> +++ b/makefiles/lib/Awt2dLibraries.gmk
> @@ -777,9 +777,13 @@
>    BUILD_LIBFONTMANAGER_MAPFILE := 
> $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
>    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
>  else
> -  FONT_HEADERS := $(FREETYPE_CFLAGS)
>    BUILD_LIBFONTMANAGER_MAPFILE := 
> $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
> -  BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
> +  ifneq ($(OPENJDK_TARGET_OS), macosx)
> +    FONT_HEADERS := $(FREETYPE_CFLAGS)
> +    BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
> +  else
> +    LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
> +  endif
>  endif
>
>  LIBFONTMANAGER_OPTIMIZATION := HIGH
>
> /Magnus
>



More information about the macosx-port-dev mailing list