Changing the font size for %rf, %rd and %rs controls does not change the size of the controls. Specifically, the height. How can this be achieved? Thanks.
Changing the font size for %rf, %rd and %rs controls
Ian
Can you provide a short sample program?
This shows that scales greater than 1 increase the size of the control. Sizes less than 1 do not decrease the size of the control.
implicit real*8 (a-h,o-z)
include <windows.ins>,nolist
character*20 text_demo(5)
Integer*4 integer_demo(5)
Real*8 text_sizes(5)
data text_demo/'Size 1','Size 2','Size 3','Size 4','Size 5'/
data integer_demo/1111,2222,3333,4444,5555/
data text_sizes/1d0,2d0,0.8d0,0.7d0,0.5d0/
ii=winio@('%fn[Arial]%ca[Control Size Demo]&')
ii=winio@('%bg[btnface]%ww&')
do i=1,5
ii=winio@('%ts&',text_sizes(i))
ii=winio@(
& '%ff%`bg[white]%`10rs %`bg[yellow]%`10rd%`bg[green]%`10rf&',
& text_demo(i),integer_demo(i),text_sizes(i))
enddo
ii=winio@('%ts',1d0)
end
Ian
I can look at this next week.
I don't recall if %ts is applied relative to the previous text size. If it is then you may need to reset to %sf for each change.
I have added a line to return to the standard font and then re-select 'Arial' ready for the next size change, see below:
implicit real*8 (a-h,o-z)
include <windows.ins>,nolist
character*20 text_demo(5)
Integer*4 integer_demo(5)
Real*8 text_sizes(5)
data text_demo/'Size 1','Size 2','Size 3','Size 4','Size 5'/
data integer_demo/1111,2222,3333,4444,5555/
data text_sizes/1d0,2d0,0.8d0,0.7d0,0.5d0/
ii=winio@('%fn[Arial]%ca[Control Size Demo]&')
ii=winio@('%bg[btnface]%ww&')
do i=1,5
ii=winio@('%ts&',text_sizes(i))
ii=winio@(
& '%ff%`bg[white]%`10rs %`bg[yellow]%`10rd%`bg[green]%`10rf&',
& text_demo(i),integer_demo(i),text_sizes(i))
c
c line added to return to standard system font and then re-choose 'Arial'
c Documentation states that a %ts=1.0 also resets the size to 1
ii=winio@('%sf%fn[Arial]&')
enddo
ii=winio@('%ts',1d0)
end
Does it work any better for a modern font such as Tahoma or Verdana?
Ian,
I was surprised by your problem, as for years I have been making controls change size.
Here's a snippet from a program that does just that:
IA = WINIO@('%hw%cc&', KHAND, GET_POSITION_FN)
IA = WINIO@('%ob[invisible]&')
IA = WINIO@('%fn[Arial]%ts&', 1.5D0)
IA = WINIO@('%`bg[white]%dd%^3rd%sfIP No.%2nl&', 1, IP, Nudge_FN)
IA = WINIO@('%fn[Segoe UI]%ts&', 0.96D0)
IA = WINIO@(' Easting%2taNorthing%nl&')
IA = WINIO@('%`bg[white]%rf%`bg[white]%rf&', X1, Y1)
IA = WINIO@(' IP coordinates&')
IA = WINIO@('%2nl%`bg[white]%fl&', 0.1D0, 1000.0D0)
IA = WINIO@('%co[check_on_focus_loss]%rf%`fl&', TL)
IA = WINIO@(' Tangent length&')
IA = WINIO@('%cb&')
IA = WINIO@('%fn[Segoe UI]%ts&', 0.96D0)
IA = WINIO@('%ff%nl%rj%8`bb[ACCEPT1/Accept] '//
& '%8bb[CANCEL1/Cancel]')
... and no, sorry, I don't know what you are doing wrong.
Eddie
Using the modern fonts makes no difference. The text sizes change, but the control into which it fits does not necessarily change its height if a smaller font is chosen. It does however change its width.
The results compared to a scale of 1 are:
---------------- Control ----------------
Scale | Font height ----- | ----- Height ----- | ------ Width -----
0.8 | smaller than 1.0 | smaller than 1.0 | Narrower than 1.0 0.7 | smaller than 0.8 | equal to 0.8 | Narrower than 0.8 0.5 | smaller than 0.7 | equal to 0.7 | Narrower than 0.7 2.0 | greater than 1.0 | greater than 1.0 | Greater than 1.0
Updated program
data integer_demo/1111,2222,3333,4444,5555/
data text_sizes/1d0,0.8d0,0.7d0,0.5d0,2d0/
ii=winio@('%fn[Verdana]%ca[Control Size Demo]&')
ii=winio@('%bg[btnface]%ww%ff&')
do i=1,5
ii=winio@('%ts&',text_sizes(i))
ii=winio@('%`bg[yellow]%`10rs &',
& text_demo(i)) !,integer_demo(i),text_sizes(i))
c
c line added to return to standard system font and then re-choose 'Arial'
c Documentation states that a %ts=1.0 also resets the size to 1
ii=winio@('%sf%fn[Verdana]&')
enddo
ii=winio@('%ts',1d0)
end
Ian
I have had a look at this and it seems that this behaviour has not changed from the outset. Values below 1.0 for %ts do not change the height of %rd, %rf and %rs.
I can add something (perhaps to %co so that it will not affect any existing code) and see if I can think of a temporary work-around.
That would be great -thanks
A new option %co[no_min_height] has now been added for the next release of ClearWin+. %co[min_height] restores the default.
This allows the height of a %rd,%rf,%rs or %re control to decrease for %ts values less than 1.0.
These controls are based on a Microsoft edit control and the new option gives a much better display. The vertical centring is not ideal but this is a limitation of the underlying Microsoft control.
Paul, Thanks - Very much appreciated. I look forward to the next release. When will that be?
One other similar thing, which is just to notify you but for which I'm not expecting an update, is several years ago, I tried to reduce the size of a jpeg I had read in. Only increasing the size worked in those days. Was that a known bug or has it been fixed? I got around it in another way and no longer use that software so, no pressure.
Thanks
Ian
The next interim release will follow the release of the Personal Edition of FTN95 v9.10. If you already have v9.10 then I could probably send you something straight away. Please contact me via a pm.
If you can provide a working sample program for the jpeg issue then I will aim to investigate that issue.
Paul, Thanks a lot. Regarding the jpeg sizing, I do not have a working program for that, it was just a distant memory as all memories are at my age! Regards Ian