Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-12

FreeType 2 with Free Pascal

18 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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'

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
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.

Reply by email

Krishna
to Graeme Geldenhuys: Has anybody ever used the FreeType 2 library directly with Free Pascal? Anybody know of…

Hi Graeme,

Graeme Geldenhuys 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

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt: The unit freetypeh.pp in fcl/image contains the header translations. The freetype unit in…

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 -

Michael Van Canneyt wrote 18 lines
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 - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Graeme Geldenhuys
to Krishna: That is all it does, generate glyphs. Do you intend to build a text rendering subsystem?…
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.

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 -

Reply by email

Michael Van Canneyt
to Krishna: That is all it does, generate glyphs. Do you intend to build a text rendering subsystem?…
Krishna wrote 11 lines
Hi Graeme, On 12/29/06, Graeme Geldenhuys 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.

Reply by email

Krishna
to Michael Van Canneyt

Hi Michael,

Michael Van Canneyt wrote 13 lines
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

Reply by email

Jeff Pohlmeyer
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

Reply by email

Florian Klaempfl
to Jeff Pohlmeyer
Show quoted text 5 lines
> 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?

Show quoted text 9 lines
- Jeff ------------------------------------------------------------------------ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Michael Van Canneyt
to Florian Klaempfl
Florian Klaempfl wrote 8 lines
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.

Reply by email

Florian Klaempfl
to Michael Van Canneyt
Show quoted text 11 lines
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 :)?

Reply by email

Michael Van Canneyt
to Florian Klaempfl
Florian Klaempfl wrote 14 lines
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.

Reply by email

Michael Van Canneyt
to Florian Klaempfl: You take care of it :)?
Florian Klaempfl wrote 14 lines
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.

Reply by email

Jonas Maebe
to Michael Van Canneyt
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

Reply by email

Michael Van Canneyt
to Jonas Maebe
Jonas Maebe wrote 10 lines
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.

Reply by email

Michael Van Canneyt
to Jonas Maebe: There are a few problems: a) there was a missing dependency on the x11 package in the…
Jonas Maebe wrote 10 lines
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.

Reply by email

Krishna
to Graeme Geldenhuys: Has anybody ever used the FreeType 2 library directly with Free Pascal? Anybody know of…

Hi Graeme,

Graeme Geldenhuys wrote 12 lines
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

Reply by email

Graeme Geldenhuys
to Krishna
Krishna 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'

Reply by email