Sign in Join

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

Mailing lists / fpc-pascal / 2014-05

Canvas.TextStyle

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Juha Manninen

Why can't I set members of TextStyle in TCanvas?
For example :

  Canvas.TextStyle.RightToLeft := True;

or

  Canvas.TextStyle.Layout := tlTop;

give :
Error: Argument can't be assigned to

Canvas.TextStyle is a replacement for Delphi's Canvas.TextFlags, isn't it?

Reply by email

Juha Manninen
to Sven Barth
Sven Barth wrote
Ok, then this becomes an LCL issue. How to port Delphi code like
  Canvas.TextFlags := Canvas.TextFlags or ETO_RTLREADING
  Canvas.TextFlags := Canvas.TextFlags or LAYOUT_SUPERSCRIPT;

TextStyle was the closest thing to TextFlags I could find. If nobody knows the answer, I will continue my experiments. I know this is not a Lazarus list.

Regards,
Juha

Reply by email

Sven Barth
to Juha Manninen
Juha Manninen wrote 10 lines
On Sat, May 24, 2014 at 2:26 PM, Sven Barth wrote: > http://wiki.freepascal.org/User_Changes_2.4.0#Treating_direct-mapped_properties_as_regular_fields Ok, then this becomes an LCL issue. How to port Delphi code like Canvas.TextFlags := Canvas.TextFlags or ETO_RTLREADING Canvas.TextFlags := Canvas.TextFlags or LAYOUT_SUPERSCRIPT; TextStyle was the closest thing to TextFlags I could find. If nobody knows the answer, I will continue my experiments. I know this is not a Lazarus list.

I don't know what exactly TextStyle provides, but if it has fields similar to the flags of TextFlags the following would be the way to go:

=== code begin ===

var
   t: TextStyle;
begin
   t := Canvas.TextStyle;
   t.RtlReading := True;
   t.SuperScript := True;
   Canvas.TextStyle := t;
end;

=== code end ===

Regards,
Sven

Reply by email