Author Topic: Issues with _change_all_wfonts() and _default_font()  (Read 2829 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Issues with _change_all_wfonts() and _default_font()
« on: June 16, 2017, 05:20:29 PM »
I created some macros (see attached) that call _change_all_wfonts() and/or _default_fonts(), but they don't always seem to be working.

In all cases, I try to run either:

font-size-test1 12
or
font-size-test2 12

The argument is the font size. You can also try other font sizes besides 12 in case you are already at size 12 and want to see it change.

font-size-test1 uses _change_all_wfonts() while font-size-test2 uses _default_font()

When I say "fail", what I mean is that the actual font size on the editor window (with C++ source file open) does not change, however if I go into Tools->Options->Appearance->Fonts, the font size shown there has the right value, but the font size on the screen in the actual window never changed and does not match what is in Tools->Options->Appearance->Fonts.

Summary of tests and failures:

In Linux, with cfg=CFG_UNICODE_SOURCE_WINDOW
 - font-size-set1 12 works properly
 - font-size-set2 12 fails
In Linux, with cfg=CFG_WINDOW_TEXT
 - font-size-set1 12 works properly
 - font-size-set2 12 fails
 
In Windows, with cfg=CFG_UNICODE_SOURCE_WINDOW
 - font-size-set1 12 fails (however the font in "search results" window seems to sometimes change
 - font-size-set2 12 fails
In Windows, with cfg=CFG_WINDOW_TEXT
 - font-size-set1 12 works properly
 - font-size-set2 12 fails

I am using:
Windows: 21.0.3 with no hotfixes
Linux: 21.0.3 with hotfix 1

Also, what is the difference between CFG_UNICODE_SOURCE_WINDOW and CFG_WINDOW_TEXT? Why in Linux do both work for _change_all_wfonts(), but in windows only CFG_WINDOW_TEXT works for _change_all_wfonts() while CFG_UNICODE_SOURCE_WINDOW fails?

Thanks,
Rob
« Last Edit: June 16, 2017, 05:29:13 PM by rowbearto »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6882
  • Hero Points: 530
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #1 on: June 19, 2017, 05:11:50 PM »
Most internal font names can't be sized (like Default Fixed Font). Try changing your font to a real font (like Courier New).

We made some enhancements to this for v22. v22 will automatically determine the real font being used and then change it's size.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #2 on: June 19, 2017, 05:23:33 PM »
I already have my font set to Courier New, and I still have this problem.

Also, in Windows, why does font size change in "Search Results" and in the Tools->Options, but not in the editor window?

I think there is a bug here.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6882
  • Hero Points: 530
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #3 on: June 19, 2017, 05:25:50 PM »
Oops. I thought you were using wfont-zoom-in

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6882
  • Hero Points: 530
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #4 on: June 19, 2017, 05:36:13 PM »
I'm just trying font_size_set1. It seems to always change the edit window fonts for me. If I use CFG_UNICODE_SOURCE_WINDOW then it changes my unicode source windows. If I use CFG_WINDOW_TEXT, then it changes my non-unicode source windows.

Search results always change for me when I use CFG_UNICODE_SOURCE_WINDOW. It's a unicode results edit window.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #5 on: June 19, 2017, 05:50:32 PM »
How do I know if my source window is a Unicode or non-unicode window?

Those results are consistent with what I found for this case in Windows:

In Windows, with cfg=CFG_WINDOW_TEXT
 - font-size-set1 12 works properly
 - font-size-set2 12 fails

For my other case of:
In Windows, with cfg=CFG_UNICODE_SOURCE_WINDOW
 - font-size-set1 12 fails (however the font in "search results" window seems to sometimes change
 - font-size-set2 12 fails

Perhaps my window is a non-unicode window, but I don't know how to figure this out? Why are there 2 different source window types?

Also, what about font-size-set2? This uses the default_fonts(). This did not work for me.

Additionally, are you trying Windows or Linux?


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6882
  • Hero Points: 530
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #6 on: June 19, 2017, 05:57:50 PM »
Changing the default font doesn't effect existing windows. You must open a new window.

Slickedit has two native buffer formats. This allows slickedit to open either UTF8 or active code page files without translating them. For completeness, you can configure different fonts for each. We are not sure that this is very useful anymore. Probably could get away with using the same font for both now.

Just set them both to the same font.

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: Issues with _change_all_wfonts() and _default_font()
« Reply #7 on: June 19, 2017, 06:44:45 PM »
Thanks for the tip Clark. I have changed my macro to set both window types to the same font, and now it works well.

And thanks for the explanation about _default_font().