1. Bernhard Giesriegl
  2. PowerBuilder
  3. Wednesday, 14 August 2024 12:47 PM UTC

Hi all,

how do I change the font in a TX-Text Control before I put in text using rte.Replacetext?

(So the text should be displayed e.g. in Tahoma Bold 14pt)

 

Any help welcome!

 

Thanks,

Best regards

Bernhard

Bernhard Giesriegl Accepted Answer Pending Moderation
  1. Monday, 19 August 2024 05:53 AM UTC
  2. PowerBuilder
  3. # 1

Hi David,

thanks for your idea (and sorry for the late reply), looks a little complicated for me.

I tried now with SelectText and SetTextStyle and that worked for me in combination with the undocumented ColorLogFont(handle(rte),setlogfontmsg,0,is_logfont) function.

But its a little pity that the great TX Text Control doesn't have a function like SetTextFont(facename, height, bold, ...) which you can use BEFORE you call ReplaceText to input text.

Also setting of tabs with something like SetTab(position,left|right|...) would be very helpful.

I am asking for this for years but it will not be realized, don't know why.

 

Best regards

Bernhard

 

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 21 August 2024 13:39 PM UTC
Glad you found s solution.
  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Wednesday, 14 August 2024 15:08 PM UTC
  2. PowerBuilder
  3. # 2

Hi

You would need to format the string with the RTF font codes.

You could try using the PB CopyRFT() function to get some selected text that has the font you want applied. You could use that information to figure out the correct syntax needed to paste formatted text in. Then write your code accordingly.

I have not tried this, it's just a random thought that might help.

Regards

David

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.