Hi, I'm writing text over an TFPImageCanvas using TFreeTypeFont, and would like to know how can I write rotated text.
The "orientation" property doesn't seems to do anything using this font class.
Thanks in advance,

Mailing lists / lazarus / 2011-05
19 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi, I'm writing text over an TFPImageCanvas using TFreeTypeFont, and would like to know how can I write rotated text.
The "orientation" property doesn't seems to do anything using this font class.
Thanks in advance,
This is not yet supported in fpImage.
I don't know whether FreeType supports rotated text.
Michael.
Well, yes, it does. Here is an example:
http://www.freetype.org/freetype1/image/freetst2.png
Ok, in that case please file a feature request in the bugtracker so I don't forget. (better yet if you could provide a patch ;) )
Michael.
2011/5/27 Michael Van Canneyt :
I am traveling now, so can't check, but if I recall correctly, nogui demo of TAChart does include rotated labels with freetype text.
Hi Alexander, I get this when I run noguidemo on Ubuntu 11.04 64bits.
[FORMS.PP] ExceptionOccurred
Sender=FreeTypeException
Exception=Error 10 while making string bitmaps step 4 Stack trace:
$000000000071FBBE
$000000000071FC4B
$000000000072189F
$0000000000722090
$000000000071F62E
$000000000071F2BE
$000000000047B3EA
$0000000000479F61
$000000000048A72A line 275 of ../../tadrawerfpcanvas.pas $000000000048C2BB line 344 of ../../tadrawutils.pas $0000000000617B6C line 634 of ../../tatypes.pas
$0000000000615348 line 666 of ../../tachartaxis.pas $0000000000614FF0 line 689 of ../../tachartaxis.pas $000000000061605C line 915 of ../../tachartaxis.pas $0000000000483753 line 1052 of ../../tagraph.pas
$0000000000481CFE line 711 of ../../tagraph.pas
$000000000042F188 line 39 of noguidemo.lpr
TApplication.HandleException Error 10 while making string bitmaps step 4 Stack trace:
$000000000071FBBE
$000000000071FC4B
$000000000072189F
$0000000000722090
$000000000071F62E
$000000000071F2BE
$000000000047B3EA
$0000000000479F61
$000000000048A72A line 275 of ../../tadrawerfpcanvas.pas $000000000048C2BB line 344 of ../../tadrawutils.pas $0000000000617B6C line 634 of ../../tatypes.pas
$0000000000615348 line 666 of ../../tachartaxis.pas $0000000000614FF0 line 689 of ../../tachartaxis.pas $000000000061605C line 915 of ../../tachartaxis.pas $0000000000483753 line 1052 of ../../tagraph.pas
$0000000000481CFE line 711 of ../../tagraph.pas
$000000000042F188 line 39 of noguidemo.lpr
exception at 000000000071FBBE:
Error 10 while making string bitmaps step 4.
Leonardo M. Ram? wroteError 10 while making string bitmaps step 4.
Please try changing "Arial" to another font in the demo source
Alexander, I tried with DejaVuSans and got the same result.
Leonardo M. Ram? wroteAlexander, I tried with DejaVuSans and got the same result.
Too bad. I have only tested on Windows -- no idea why FreeType does not work on other platforms.
Read the fine manual:
http://wiki.lazarus.freepascal.org/fcl-image#Drawing_text
Mattias
FreeType works, what does not work is the rotation.
Where does TAChart with FreeType call InitEngine?
Mattias
FreeType works, what does not work is the rotation. Leonardo M. Ram?…
I had a check, it should not be too hard to add the rotation. But at least 3 functions must be adapted.
Michael.
On Fri, 27 May 2011 21:37:21 -0300 Where does TAChart with FreeType call InitEngine?…
The call is in in line 146 of ftfont.pp
On Windows, I verified that it is is called before other low-level freetype functions.
Maybe it is not so on other platforms -- I think
the call should then be removed from ftfont unit.
I had a check, it should not be too hard to add the rotation. But at least 3 functions…
2011/5/28 Michael Van Canneyt :
> FreeType works, what does not work is the rotation. I had a check, it should not be too hard to add the rotation. But at least 3 functions must be adapted.
It already works under Windows, so I am not sure why further modification is needed.
Probably because you are not using freetype, but LCL windows fonts.
The Free Pascal FreeType has no support for orientation, for the simple reason that the property didn't exist when freetype support was implemented.
You don't need to take my word for it, just check the sources.
Michael.
Michael Van Canneyt wroteThe Free Pascal FreeType has no support for orientation, for the simple reason that the property didn't exist when freetype support was implemented. You don't need to take my word for it, just check the sources.
I have already checked them when I implemented font rotation in TAChart/FPCanvas.
See
https://github.com/graemeg/freepascal/blob/master/packages/fcl-image/src/ftfont.pp#L238 https://github.com/graemeg/lazarus/blob/upstream/components/tachart/tadrawerfpcanvas.pas#L255
Ah. Well, how am I supposed to know about that ?
The Git repository is private for Graeme. Changes to it are not communicated back to FPC.
Why did you not submit a patch to FPC ?
Michael.
Forget this reply;I understood you wrong, I thought you had implemented it and committed it in Git.
There is a property Angle there (private to FreeType font), but I was looking for Orientation (the LCL and FPCanvas property).
The Angle property should of course be translated to Orientation, to match the LCL.
My apologies for the too fast reaction :/
Michael.