ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to get Font Style from Text Layer?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Apr 05 2020 :  10:56:17  Show Profile  Reply
Hello,

I want to get following about font of selected text layer:
  • Font Name (which I can get using TIETextLayer( lyr ).Font.Name)
  • Font Style like Bold/Italic/Bold Italic/Underline/etc
  • Font Size (which I can get using TIETextLayer( lyr ).Font.Size)
  • Font Color


TIA


Yogi Yang

klausdoege

Germany
389 Posts

Posted - Apr 05 2020 :  14:42:44  Show Profile  Reply
Hi Yogi,
see the help -> TIETextLayer
All you can find there.

Klaus
www.klausdoege.de
Go to Top of Page

xequte

38175 Posts

Posted - Apr 05 2020 :  18:51:43  Show Profile  Reply
Is it a plain text or rich text layer? (EnableFormatting enabled or not)

If it's plain text, then just use:

TIETextLayer( lyr ).Font.Style

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Apr 05 2020 :  23:46:55  Show Profile  Reply
Hello,

It is plain text. Next I have tried to read Style info using following code:
fs: TFontStyle;

fs := TIETextLayer( lyr ).Font.Style;

But this does not compile.

I need to distinguish the formatting info and accordingly show associated buttons down or up.

I checked the help and tried everything before posing here.

TIA


Yogi Yang
Go to Top of Page

xequte

38175 Posts

Posted - Apr 07 2020 :  05:52:18  Show Profile  Reply
What is the compilation error?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Apr 08 2020 :  03:58:22  Show Profile  Reply
Hello Nigel,

I have solved the problem now.

Instead of creating a font style variable I am using it like this:
FntName := TIETextLayer(lyr).Font.Name;
  FntSize := TIETextLayer(lyr).Font.Size;
  FntClr := TIETextLayer(lyr).Font.Color;

if fsBold in TIETextLayer(lyr).Font.Style then


TIA


Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: