No ftcache in freetype?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

No ftcache in freetype?

Owain Ainsworth-2
Hi all,

I'm currently trying to port vtk (http://vtk.org) to OpenBSD, it works
fine despite the lack of 3D acceleration (i've been using it for
projects of mine for around a year). However, one thing that always
annoyed me was that I could never get it to work with the system
freetype library, it always failing on a link. Example at the end of the
email. This is particularly annoying since the Qt bindings for VTK link
with Qt, with does have freetype, so you always get a linker warning of
a symbol size mismatch when you build a project using both Qt and VTK
with VTK's built in freetype.

Having finally had the time to look into this. Although the headers are
installed, building freetype doesn't appear to build freetype/src/cache/*. This
is what's causing the linker errors. Since the symbols involved are
defined in ftcache.c.

Since AFAIK this is an X11 problem, not a ports@ problem i've come here.

I suppose my question is this:
Is there a reason why the cache subsystem isn't built? If not, would it
be possible to build it.

Thanks for your time.

Regards,

Owain

output of build follows:
-----Final part of output from make in fledgeling VTK port: ---
cd /usr/bld/i386/vtk-5.0.3/VTK/Graphics/Testing/Cxx && /usr/bin/c++
-O2 -pipe    -Wno-deprecated  -fPIC
"CMakeFiles/GraphicsCxxTests.dir/GraphicsCxxTests.o"
"CMakeFiles/GraphicsCxxTests.dir/Mace.o"
"CMakeFiles/GraphicsCxxTests.dir/expCos.o"
"CMakeFiles/GraphicsCxxTests.dir/BoxClipTriangulate.o"
"CMakeFiles/GraphicsCxxTests.dir/CellLocator.o"
"CMakeFiles/GraphicsCxxTests.dir/PointLocator.o"
"CMakeFiles/GraphicsCxxTests.dir/FrustumClip.o"
"CMakeFiles/GraphicsCxxTests.dir/RGrid.o"
"CMakeFiles/GraphicsCxxTests.dir/TestSortDataArray.o"
"CMakeFiles/GraphicsCxxTests.dir/vtkTestHierarchicalDataReader.o"   -o
./../../bin/GraphicsCxxTests  -L/usr/bld/i386/vtk-5.0.3/VTK/bin
-L/usr/X11R6/lib -L/usr/local/lib -lvtkRendering -lvtkIO -lvtkGraphics
-lvtkImaging -lvtkftgl -lfreetype -lGL -lXt -lSM -lICE -lSM -lICE -lX11
-lXext -lX11 -lXext -lvtkFiltering -lvtkCommon -lvtksys -lpthread -lm
-lvtkDICOMParser -lpng -lz -lz -ljpeg -ltiff -lexpat
/usr/X11R6/lib/libGL.so.5.1: warning: vsprintf() is often misused,
please use vsnprintf()
CMakeFiles/GraphicsCxxTests.dir/GraphicsCxxTests.o(.text+0x30): In
function `lowercase(char const*)':
: warning: strcpy() is almost always misused, please use strlcpy()
CMakeFiles/GraphicsCxxTests.dir/vtkTestHierarchicalDataReader.o(.text+0xb04):
In function `vtkTestHierarchicalDataReader::GetBlockFileName(int)':
: warning: sprintf() is often misused, please use snprintf()
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: warning:
strcat() is almost always misused, please use strlcat()
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_ImageCache_New'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_CMapCache_New'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_Manager_Done'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_Manager_LookupFace'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_Manager_New'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_ImageCache_Lookup'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_CMapCache_Lookup'
/usr/bld/i386/vtk-5.0.3/VTK/bin/libvtkRendering.so.5.0: undefined
reference to `FTC_Manager_LookupSize'
collect2: ld returned 1 exit status
*** Error code 1

Stop in /usr/bld/i386/vtk-5.0.3/VTK (line 318 of
Graphics/Testing/Cxx/CMakeFiles/GraphicsCxxTests.dir/build.make).
*** Error code 1

Stop in /usr/bld/i386/vtk-5.0.3/VTK (line 1957 of CMakeFiles/Makefile2).
*** Error code 1

Stop in /usr/bld/i386/vtk-5.0.3/VTK (line 99 of Makefile).
*** Error code 1

--
The rights you have are the rights given you by this Committee [the
House Un-American Activities Committee].  We will determine what rights
you have and what rights you have not got.
                -- J. Parnell Thomas

Reply | Threaded
Open this post in threaded view
|

Re: No ftcache in freetype?

Matthieu Herrb
Owain Ainsworth wrote:

> Hi all,
>
> I'm currently trying to port vtk (http://vtk.org) to OpenBSD, it works
> fine despite the lack of 3D acceleration (i've been using it for
> projects of mine for around a year). However, one thing that always
> annoyed me was that I could never get it to work with the system
> freetype library, it always failing on a link. Example at the end of the
> email. This is particularly annoying since the Qt bindings for VTK link
> with Qt, with does have freetype, so you always get a linker warning of
> a symbol size mismatch when you build a project using both Qt and VTK
> with VTK's built in freetype.
>
> Having finally had the time to look into this. Although the headers are
> installed, building freetype doesn't appear to build freetype/src/cache/*. This
> is what's causing the linker errors. Since the symbols involved are
> defined in ftcache.c.
>
> Since AFAIK this is an X11 problem, not a ports@ problem i've come here.
>
> I suppose my question is this:
> Is there a reason why the cache subsystem isn't built? If not, would it
> be possible to build it.
>

Which OpenBSD version are you using ? it that 4.1 (with X.Org 6.9 and
thus Freetype 2.1) or -current (with X.Org 7.2 and freetype 2.2.1)?

On those 2 versions the official freetype build system don't seem to
build this directory either. So I'm not sure if it's some "experimental"
feature not yet enabled or an obsolete one, supposed to be removed.
If someone has some information, I'd like to hear about it.
--
Matthieu Herrb

Reply | Threaded
Open this post in threaded view
|

Re: No ftcache in freetype?

Owain Ainsworth-2
Hi Matthieu,

On Fri, Jul 13, 2007 at 10:20:00AM +0200, Matthieu Herrb wrote:
> Which OpenBSD version are you using ? it that 4.1 (with X.Org 6.9 and
> thus Freetype 2.1) or -current (with X.Org 7.2 and freetype 2.2.1)?

I'm running -current from about two weeks ago. So the latter. The
codebase I checked for this problem was xenocara.

>
> On those 2 versions the official freetype build system don't seem to
> build this directory either. So I'm not sure if it's some "experimental"
> feature not yet enabled or an obsolete one, supposed to be removed.
> If someone has some information, I'd like to hear about it.

Doing a bit more research on this issue. The freetype2 website
(http://www.freetype.org/freetype2/index.html#features) states:

-FreeType 2 provides its own caching subsystem since release 2.0.1. It
can be used to cache either face instances or glyph images efficiently.

making me believe it is Newer. IIRC i think i remember seeing somewhere
that the API is somewhat unstable, but the performance is fine.
Unfortunately I don't remember where I read this.

The README file for freetype (both the VTK one, 2.1.9 and the xenocara
one) states:    
-- auxiliary modules (optional)

      src/autofit/autofit.c   -- auto hinting module
      src/cache/ftcache.c     -- cache sub-system (in beta)
      src/gzip/ftgzip.c       -- support for compressed fonts (.gz)
      src/lzw/ftlzw.c         -- support for compressed fonts (.Z)
      src/gxvalid/gxvalid.c   -- TrueTypeGX/AAT table validation
      src/otvalid/otvalid.c   -- OpenType table validation
      src/psaux/psaux.c       -- PostScript Type 1 parsing
      src/pshinter/pshinter.c -- PS hinting module
      src/psnames/psnames.c   -- PostScript glyph names support


Also looking at the README.VTK.txt in the vtk distibution for freetype,
the introductory blurb states:

  This directory contains a subset of the Freetype library (2.1.9) + some
  recent
  updates made to the cache subsystem.

  We only include enough of the distribution to provide the
  functionalities
  required by VTK.

  We would like to thank the Freetype team for distributing this library.
  http://www.freetype.org

Which confirms my thought that the cache subsystem is required.

I have come to the conclusion that the confusion from the matter arises
that freetype installed the ftcache.h header automatically, even when
ftcache.c is _not_ built.

I'm away this weekend, i'll do some testing with the cache subsystem
enabled in freetype sometime next week. I'll report back on stability.

If it turns out that it can't be enabled i'll have to make my port use
the built-in that comes with VTK and just get used to the linker
problems (apart from that it works perfectly).

News, and either way the port should be forthcoming next week.

If there's anything else you'd like me to check, let me know.

> Matthieu Herrb

Regards,

-0-

--
Idaho state law makes it illegal for a man to give his sweetheart a box
of candy weighing less than fifty pounds.

Reply | Threaded
Open this post in threaded view
|

Re: No ftcache in freetype?

Matthieu Herrb
Owain Ainsworth wrote:

> Hi Matthieu,
>
> On Fri, Jul 13, 2007 at 10:20:00AM +0200, Matthieu Herrb wrote:
>> Which OpenBSD version are you using ? it that 4.1 (with X.Org 6.9 and
>> thus Freetype 2.1) or -current (with X.Org 7.2 and freetype 2.2.1)?
>
> I'm running -current from about two weeks ago. So the latter. The
> codebase I checked for this problem was xenocara.
>
>> On those 2 versions the official freetype build system don't seem to
>> build this directory either. So I'm not sure if it's some "experimental"
>> feature not yet enabled or an obsolete one, supposed to be removed.
>> If someone has some information, I'd like to hear about it.
>
> Doing a bit more research on this issue. The freetype2 website
> (http://www.freetype.org/freetype2/index.html#features) states:
>
> -FreeType 2 provides its own caching subsystem since release 2.0.1. It
> can be used to cache either face instances or glyph images efficiently.
>
> making me believe it is Newer. IIRC i think i remember seeing somewhere
> that the API is somewhat unstable, but the performance is fine.
> Unfortunately I don't remember where I read this.
>
> The README file for freetype (both the VTK one, 2.1.9 and the xenocara
> one) states:    
> -- auxiliary modules (optional)
>
>       src/autofit/autofit.c   -- auto hinting module
>       src/cache/ftcache.c     -- cache sub-system (in beta)
>       src/gzip/ftgzip.c       -- support for compressed fonts (.gz)
>       src/lzw/ftlzw.c         -- support for compressed fonts (.Z)
>       src/gxvalid/gxvalid.c   -- TrueTypeGX/AAT table validation
>       src/otvalid/otvalid.c   -- OpenType table validation
>       src/psaux/psaux.c       -- PostScript Type 1 parsing
>       src/pshinter/pshinter.c -- PS hinting module
>       src/psnames/psnames.c   -- PostScript glyph names support
>
>
> Also looking at the README.VTK.txt in the vtk distibution for freetype,
> the introductory blurb states:
>
>   This directory contains a subset of the Freetype library (2.1.9) + some
>   recent
>   updates made to the cache subsystem.
>
>   We only include enough of the distribution to provide the
>   functionalities
>   required by VTK.
>
>   We would like to thank the Freetype team for distributing this library.
>   http://www.freetype.org
>
> Which confirms my thought that the cache subsystem is required.
>
> I have come to the conclusion that the confusion from the matter arises
> that freetype installed the ftcache.h header automatically, even when
> ftcache.c is _not_ built.

Thanks for taking the time to investigate this issue and for this
information.

>
> I'm away this weekend, i'll do some testing with the cache subsystem
> enabled in freetype sometime next week. I'll report back on stability.
>
> If it turns out that it can't be enabled i'll have to make my port use
> the built-in that comes with VTK and just get used to the linker
> problems (apart from that it works perfectly).
>
> News, and either way the port should be forthcoming next week.

Ok. Looking forward for your input/

--
Matthieu Herrb