FreeType 2 with Free Pascal

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

FreeType 2 with Free Pascal

Graeme Geldenhuys-2
Hi,

Has anybody ever used the FreeType 2 library directly with Free
Pascal? Anybody know of converted C headers for FreeType 2?

I want to implement anti-aliased text in my fpGUI widget set and
started with Xft, but that only works under Linux and not Windows. Not
really a issue I guess, I just heard that FreeType 2 apparently
generates even better glyphs under Windows than Windows inself can.
Also FreeType 2 is self contained, so the requirements would be even
less if I use it compared to Xft.

Xft for those that don't know uses FreeType 2, but requires the
XRender extension.  Anybody know more about FreeType 2 itself - am I
heading in the wrong direction wanting to use FreeType 2 directly?

--
Graeme Geldenhuys
There's no place like S34° 03.168'  E018° 49.342'
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

michael.vancanneyt


On Fri, 29 Dec 2006, Graeme Geldenhuys wrote:

> Hi,
>
> Has anybody ever used the FreeType 2 library directly with Free
> Pascal? Anybody know of converted C headers for FreeType 2?

The unit freetypeh.pp in fcl/image contains the header translations.
The freetype unit in fcl/image contains a decent pascal interface
for the freetypeh routines.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Krishna-33
In reply to this post by Graeme Geldenhuys-2
Hi Graeme,

On 12/29/06, Graeme Geldenhuys <[hidden email]> wrote:
> I want to implement anti-aliased text in my fpGUI widget set and
> started with Xft, but that only works under Linux and not Windows. Not
> really a issue I guess, I just heard that FreeType 2 apparently
> generates even better glyphs under Windows than Windows inself can.

That is all it does, generate glyphs. Do you intend to build a text
rendering subsystem? If not, then you are better off using Xft on X
and the native API on Win32.

Cheers,
Krishna
--
I long to accomplish a great and noble task, but it is my chief duty
to accomplish small tasks as if they were great and noble !
- Helen Keller
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Graeme Geldenhuys-2
In reply to this post by michael.vancanneyt
Thanks Michael.

I'll have a look at it shortly...  I see they have FreeType 1
implemented it Pascal and C, but unfortunately FreeType 2 only in C.

Regards,
  - Graeme -


On 12/29/06, Michael Van Canneyt <[hidden email]> wrote:

>
>
> On Fri, 29 Dec 2006, Graeme Geldenhuys wrote:
>
> > Hi,
> >
> > Has anybody ever used the FreeType 2 library directly with Free
> > Pascal? Anybody know of converted C headers for FreeType 2?
>
> The unit freetypeh.pp in fcl/image contains the header translations.
> The freetype unit in fcl/image contains a decent pascal interface
> for the freetypeh routines.
>
> Michael.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Graeme Geldenhuys-2
In reply to this post by Krishna-33
On 12/29/06, Krishna <[hidden email]> wrote:
> That is all it does, generate glyphs. Do you intend to build a text
> rendering subsystem? If not, then you are better off using Xft on X
> and the native API on Win32.

I am evaluating that idea.  Just trying to find all the pro's and
con's.  Not to mention how much work it would be, but if the end
result is more flexible and much better looking it should be worth it.

Regards,
 - Graeme -
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Michael Van Canneyt
In reply to this post by Krishna-33


On Fri, 29 Dec 2006, Krishna wrote:

> Hi Graeme,
>
> On 12/29/06, Graeme Geldenhuys <[hidden email]> wrote:
> > I want to implement anti-aliased text in my fpGUI widget set and
> > started with Xft, but that only works under Linux and not Windows. Not
> > really a issue I guess, I just heard that FreeType 2 apparently
> > generates even better glyphs under Windows than Windows inself can.
>
> That is all it does, generate glyphs. Do you intend to build a text
> rendering subsystem? If not, then you are better off using Xft on X
> and the native API on Win32.

Yes and no. The fpimage system was designed to run on a systeem without
graphical display:  Windows services or Linux servers without X.
The use of freetype allows you to draw text on a bitmap and e.g.
send it to a remote client. (e.g. from a cgi program)

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Krishna-33
Hi Michael,

On 12/30/06, Michael Van Canneyt <[hidden email]> wrote:

>
>
> On Fri, 29 Dec 2006, Krishna wrote:
>
> > That is all it does, generate glyphs. Do you intend to build a text
> > rendering subsystem? If not, then you are better off using Xft on X
> > and the native API on Win32.
>
> Yes and no. The fpimage system was designed to run on a systeem without
> graphical display:  Windows services or Linux servers without X.
> The use of freetype allows you to draw text on a bitmap and e.g.
> send it to a remote client. (e.g. from a cgi program)
>

Agreed but the common case is the window systems. Not using Xft means
that you have to (re)implement things like glyph caching, acceleration
using RENDER extension etc. For things like CGI, I think you're better
off using a canvas library (cairo, evas come to mind).

Another route is to dump fpImg and use a higher level canvas library
like cairo to do all the drawing. Donno about the performance
penalties but Gtk+ seems to be doing ok.

btw, is there a (free)pascal translation of the cairo headers?

Cheers,
Krishna
--
I long to accomplish a great and noble task, but it is my chief duty
to accomplish small tasks as if they were great and noble !
- Helen Keller
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

RE: FreeType 2 with Free Pascal

Jeff Pohlmeyer
In reply to this post by Graeme Geldenhuys-2
> On Sat, 30 Dec 2006, Krishna wrote:
> btw, is there a (free)pascal translation of the cairo headers?

I started one some time back, then lost interest -
Here's what I have, X only, no Win32...

- Jeff

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

cairo.pp (35K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Florian Klämpfl
Jeff Pohlmeyer schrieb:
>> On Sat, 30 Dec 2006, Krishna wrote:
>> btw, is there a (free)pascal translation of the cairo headers?
>
> I started one some time back, then lost interest -
> Here's what I have, X only, no Win32...

Shall we include it somewhere in svn?

>
> - Jeff
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Michael Van Canneyt


On Sat, 30 Dec 2006, Florian Klaempfl wrote:

> Jeff Pohlmeyer schrieb:
> > > On Sat, 30 Dec 2006, Krishna wrote:
> > > btw, is there a (free)pascal translation of the cairo headers?
> >
> > I started one some time back, then lost interest -
> > Here's what I have, X only, no Win32...
>
> Shall we include it somewhere in svn?

Yes.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Florian Klämpfl
Michael Van Canneyt schrieb:

>
> On Sat, 30 Dec 2006, Florian Klaempfl wrote:
>
>> Jeff Pohlmeyer schrieb:
>>>> On Sat, 30 Dec 2006, Krishna wrote:
>>>> btw, is there a (free)pascal translation of the cairo headers?
>>> I started one some time back, then lost interest -
>>> Here's what I have, X only, no Win32...
>> Shall we include it somewhere in svn?
>
> Yes.

You take care of it :)?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Michael Van Canneyt


On Sat, 30 Dec 2006, Florian Klaempfl wrote:

> Michael Van Canneyt schrieb:
> >
> > On Sat, 30 Dec 2006, Florian Klaempfl wrote:
> >
> > > Jeff Pohlmeyer schrieb:
> > > > > On Sat, 30 Dec 2006, Krishna wrote:
> > > > > btw, is there a (free)pascal translation of the cairo headers?
> > > > I started one some time back, then lost interest -
> > > > Here's what I have, X only, no Win32...
> > > Shall we include it somewhere in svn?
> >
> > Yes.
>
> You take care of it :)?

Will do.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Michael Van Canneyt
In reply to this post by Florian Klämpfl


On Sat, 30 Dec 2006, Florian Klaempfl wrote:

> Michael Van Canneyt schrieb:
> >
> > On Sat, 30 Dec 2006, Florian Klaempfl wrote:
> >
> > > Jeff Pohlmeyer schrieb:
> > > > > On Sat, 30 Dec 2006, Krishna wrote:
> > > > > btw, is there a (free)pascal translation of the cairo headers?
> > > > I started one some time back, then lost interest -
> > > > Here's what I have, X only, no Win32...
> > > Shall we include it somewhere in svn?
> >
> > Yes.
>
> You take care of it :)?

Done, for all unix-like targets, including darwin.

Many thanks to Jeff.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Jonas Maebe-2

On 30 Dec 2006, at 23:24, Michael Van Canneyt wrote:

> Done, for all unix-like targets, including darwin.

There are a few problems:
a) there was a missing dependency on the x11 package in the makefile,  
which broke "make all"
b) after adding that, it still doesn't compile because it can't find  
the unit "freetypeh"


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Michael Van Canneyt


On Sat, 30 Dec 2006, Jonas Maebe wrote:

>
> On 30 Dec 2006, at 23:24, Michael Van Canneyt wrote:
>
> >Done, for all unix-like targets, including darwin.
>
> There are a few problems:
> a) there was a missing dependency on the x11 package in the makefile, which
> broke "make all"
> b) after adding that, it still doesn't compile because it can't find the unit
> "freetypeh"

Bah. It worked out of the box here. I'll have a look.
freetypeh is in fcl/image, hopefully it's included in Darwin, or otherwise
I'll have to remove cairo for Darwin for the time being :(

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: RE: FreeType 2 with Free Pascal

Michael Van Canneyt
In reply to this post by Jonas Maebe-2


On Sat, 30 Dec 2006, Jonas Maebe wrote:

>
> On 30 Dec 2006, at 23:24, Michael Van Canneyt wrote:
>
> >Done, for all unix-like targets, including darwin.
>
> There are a few problems:
> a) there was a missing dependency on the x11 package in the makefile, which
> broke "make all"
> b) after adding that, it still doesn't compile because it can't find the unit
> "freetypeh"

Should work now. Please try again, mail me in private if it needs more fixes.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Krishna-33
In reply to this post by Graeme Geldenhuys-2
Hi Graeme,

On 12/29/06, Graeme Geldenhuys <[hidden email]> wrote:

> Hi,
>
> Has anybody ever used the FreeType 2 library directly with Free
> Pascal? Anybody know of converted C headers for FreeType 2?
>
> I want to implement anti-aliased text in my fpGUI widget set and
> started with Xft, but that only works under Linux and not Windows. Not
> really a issue I guess, I just heard that FreeType 2 apparently
> generates even better glyphs under Windows than Windows inself can.
> Also FreeType 2 is self contained, so the requirements would be even
> less if I use it compared to Xft.
>

Have you considered AggPas? It is a native object pascal port of the
Antigrain Geometry library. It sure looks cool! Check it out here:
http://aggpas.org .

Cheers,
Krishna
--
I long to accomplish a great and noble task, but it is my chief duty
to accomplish small tasks as if they were great and noble !
- Helen Keller
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: FreeType 2 with Free Pascal

Graeme Geldenhuys-2
On 1/4/07, Krishna <[hidden email]> wrote:
> Have you considered AggPas? It is a native object pascal port of the
> Antigrain Geometry library. It sure looks cool! Check it out here:
> http://aggpas.org .

Wow!  That is very impressive! I'm looking through the demo's now.
Thanks for the link.


--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal