Silverfrost Forums

Welcome to our forums

Superpumped Superscripts

23 Jan 2013 7:57 #11458

Here is the example of using subscripts and superscripts with standard font with Clearwin. Both clearly have shift to the upside (see first magnified image below) . Would be great just to move all of them several pixels down like it is shown in the bottom excerpt below, with superscript probably a bit more

Also, would be great to have an option for fonts to be printed OVER the background image, not substituting the whole area under the character like it is photoshopped in bottom excerpt which definitely makes the whole GUI look more professional

http://img703.imageshack.us/img703/9010/superscr.jpg

23 Jan 2013 8:13 #11460

%eq will respond to %`bg as in the modified version of your code...

use clrwin 
i=winio@('%ww&') 
i=winio@('%ac[esc]&','exit') 
i=winio@('%tc&',rgb@(210,227,220)) 
i=winio@('%bg&',rgb@(11,18,79)) 
i=winio@('%`bg&',rgb@(0,100,0)) 
i=winio@('%1.2ob&') 
i=winio@('%eq[E=MC{sup 2}]&',0L,0L)
i=winio@('%cb&') 
i=winio@('%cn%bc%bu[white]%bt[Exit]%ff&',rgb@(104,23,9)) 
i=winio@('%cb') 
end
23 Jan 2013 9:11 #11463

Yes, i know that, but tried several times i failed to decrease the size of the formula letters almost twice to fit into the text, the %ts does not work with it... Here is example (sorry box is misfit - i did not adjust it yet after switching from XP)

http://img59.imageshack.us/img59/7662/formulasc.jpg

Is it really not possible to adjust the heights of superscripts %su %$sd ? They are clearly way, way OFF!

23 Jan 2013 10:13 #11464

I am aware that %eq has significant limitations. I will but this on the wish list.

24 Jan 2013 12:10 #11467

Thanks. Also, one related question/request: if printing text over existing background without wiping everything under it is not possible - then may be is it possible to define the background color under the text? For example last picture looks really ugly on this background but if we were able to set the right background (see the quick photoshopped attempt below) according to the used texture the result would be much better and possibly not dependent on different OS defaults (currently you change OS and all your GUI needs whole new set of backgrounds!):

http://img201.imageshack.us/img201/9898/formulas2a.jpg

24 Jan 2013 8:06 #11471

For most controls the background colour can be set using %`bg beforehand.

24 Jan 2013 10:56 #11475

Yes, it works for the $eq , thanks.

But unfortunately does not for the other comments and texts (see above first and second pictures) which i usually place using this way

i=winio@('Intensity [W/cm2] %ta%rf&',Intens)

Probably %`bg%ws will work if put the comments into character variable. Or may be there exist other ways to put background under texture ? The simplest ideal and most intuitive way of course would be the one which does not work :

i=winio@('%`bgIntensity [W/cm2] %ta%rf&',rgb@(200,200,200), Intens)
25 Jan 2013 7:57 #11483

I would expect %`bg%ws to work and I think that this is the way to do it.

27 Jan 2013 3:42 (Edited: 28 Jan 2013 11:52) #11492

Well...i tried but... The use of %rs (%ws by some reason does not work) here would be very inconvenient for complex GUIs, it's OK only for few occasional uses

Besides if it is possible to write

i=winio@('%tc[red] Intensity, W/cm2 %rf&', IWpcm2)

and it works fine, everyone would expect from Clearwin that this will also work but it does not

i=winio@('%`bg[red] Intensity, W/cm2 %rf&', IWpcm2)

Please look if you can add that, that will substantially improve the look of GUIs and mostly solve the problem of absence of transparency of background under the fonts on the windows with background textures

27 Jan 2013 8:51 #11493

OK I will see what I can do.

28 Jan 2013 11:49 #11497

Thanks, i think if implemented this will be a step to improve intuitive consistency of the language

19 Mar 2013 9:56 #11828

I have had a look at this.

%tc sets the text colour for subsequent text. %`bg set the background colour for the next control only.

It is admittedly rather confusing for the text 'Intensity, W/cm2' to be treated as a control and hence be given a red background but I think we will have to live with this.

If you need to also make the %rf background red then %`bg[red] needs to be repeated.

i=winio@('%`bg[red] Intensity, W/cm2 %`bg[red]%rf', IWpcm2)

or am I misunderstanding what you are asking for?

19 Mar 2013 11:46 #11829

Thanks for looking at this. I do not know what is happening, i spent time again looking at this, but anything i do in the larger code does not work. Will investigate again further today. In short, i know all mentioned things and use them. Unusual thing in my case is that adding the %bg[red] for example has literally zero effect on texts with %wp texture, so i thought that %bg does not work with it. Your example works though which give the hope that there is some dumb error somewhere or a bug. There are no other %bg in this specific code which could interfere with %`bg. Could be interference with named %ob or with %ps, or %lw or heck knows what in these 15K lines of CWP text...Will kill all additional features one by one and see when this will start working

29 Mar 2013 11:06 (Edited: 1 Apr 2013 8:17) #11912

I think i found the reason why %`bg does not work in my case. It is because of the use of %sy[3d_raised]

This feature allows us to place nice %wp texture backgrounds everywhere under %ob/cb. We almost never use plain boring default windows without texture. So when texture is used then %`bg[red] for example does not change the background under the text to red! Can it be done somehow?

Here is almost the same example as in other thread https://forums.silverfrost.com/Forum/Topic/2161&postdays=0&postorder=asc&start=0

demonstrating that adding %`bg[red] does not change background if %sy[3d_raised] is used. Please take any texture file or one from the mentioned thread and ignore irrelevant callback functions. Two needed lines of text are marked with the !!!<=====

Please also look at sub/superscripts. Just lowering both few pixels down would solve the problem

 integer  cbMouse, cbRun 
 external cbMouse, cbRun 
 real*8 Variab1, Variab2, Variab3 

 Variab1=1; Variab2=2; Variab3=3 
 ix=400; iy =300 
 ia=1;ib=0;ic=0;id=0 

 i=winio@('%ww[no_border,casts_shadow]&')    
 i=winio@('%sy[3d_raised]&')  !!!<=====
 I=WINIO@('%wp[moon0]&') 
 i=winio@('%mn[&File[E&xit]]&','EXIT') 
 i=winio@('%ac[esc]&','EXIT') 

 i=winio@('%nr%nd&') 
 i=winio@('%1.3ob&') 
 i=winio@('%rb[1]%rb[2]%rb[3]%rb[4]%ff&', ia,ib,ic,id) 
 i=winio@('%cb&') 

  i=winio@('%sf%`bg[red]Var1 T%sdhot%`sd  [eV] %ta%`bg[white]%10rf%ff&', Variab1)  !!!<===== 
 i=winio@('%cb&') 

 i=WINIO@('%cn%^tt[&Run]%ff&', cbRun) 

  i=winio@('Var2%su(-Var1)%`su, [cm%su-3%`su]%ta%`bg[white]%10rf%ff&',Variab2) 

 i=winio@('%cb &') 
 i=winio@('%ob&') 

 i=winio@('%pv%`^gr[full_mouse_input,box_selection,user_resize,rgb_colours,black]&',ix, iy, ihw, cbMouse) 
 i=winio@('%cb') 

 END 

 integer function cbMouse() 
 use clrwin 
 character*20 text20 
 real*8 FontSize1 
 common iwin_width_, iwin_DEPTH_ 

 text20 = 'ClearWin+' 
 FontSize1 = 14 

 LL = len_trim(text20) 
 call get_graphical_resolution@(iwin_width_, iwin_DEPTH_ ) 
 call clear_screen@() 

 111 call SELECT_FONT@('Courier New') 
     call scale_font@(FontSize1) 
     call BOLD_FONT@( 1 ) 

     call get_text_size@ (text20(1:ll), i_leng, ifontHight) 

     if(i_leng.gt.iwin_width_)then 
     FontSize1=FontSize1-0.1 
     if(FontSize1.le.0.1) goto 100 
     goto 111 
     endif 
     if(ifontHight.gt.iwin_DEPTH_)then 
     FontSize1=FontSize1-0.1 
     if(FontSize1.le.0.1) goto 100 
     goto 111 
     endif 

 100 iPosX = (iwin_width_ - i_leng)/2 
     if(iPosX.lt.0) iPosX = 0 

     iPosY = (iwin_DEPTH_ + ifontHight)/2  
     if(iPosY.lt.0) iPosY = 0 
   
     icolorSh  = rgb@(255,255,255) 
     ix0 = iPosX+1 
     iy0 = iPosY+1  
     call draw_text@ (text20(1:LL), ix0, iy0, icolorSh) 

     icolorSh  = rgb@(255,55,55) 
     ix0 = iPosX    
     iy0 = iPosY    

     call draw_text@ (text20(1:LL), ix0, iy0, icolorSh) 
 cbMouse=1 
 end 
 integer function cbRun() 
 use clrwin    
 common iwin_width_, iwin_DEPTH_ 
 call draw_text@('Good job,',20,iwin_DEPTH_/3, rgb@(255,55,55)) 
 cbRun=1 
 end 

 resources 
 moon0  BITMAP moon0.bmp
30 Mar 2013 8:00 #11915

I have logged this for investigation.

Please login to reply.