replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Formatting equations
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Formatting equations
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
arctica



Joined: 10 Sep 2006
Posts: 146
Location: United Kingdom

PostPosted: Mon Feb 10, 2025 2:35 pm    Post subject: Formatting equations Reply with quote

Hello

I have tested the %eq option with a simplified test below:

Code:
winapp

program equations

implicit none

integer :: i, w, winio@
character(len=80) :: s

s = 't{sub v} = {divide t{sub 0}; {sqrt}(1 - {divide v{sup 2}; c{sup 2}})}'

i = winio@('%ca[Equation test]%bg&',RGB@(230,245,250))

w = winio@('%ob%eq@%cb&',s,0,0)

w = winio@(' ')

end program equations


However, the formatting is not correct and I am not sure how to fix the issue. The equation is

t(sub_v) = t(sub_0) / sqrt(1 - v^2/c^2)

As it stands the denominator sqrt does not enclose the whole function and the round brackets are not extended (1-v^2/c^2), also how can the font size and clarity be improved? The zero of t(sub 0) is truncated as to is V^2, and separation between variables is not neat.

I am sure it is a simple solution but just cannot see it just yet.

Thanks for any ideas

Lester
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Mon Feb 10, 2025 5:35 pm    Post subject: Reply with quote

Lester

I don't think that you can do much to improve the outcome. %eq is somewhat limited and I get the impression that it is not often used.

There may be some improvement obtained by using a different font such as

Code:
i = winio@('%fn[Tahoma]%ts&',0.7d0)


But the best way forward could be to use a different approach such as %im to display a resource JPEG image (say) that was created using a "paint" utility.

Please reply if you need sample code and further information.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Tue Feb 11, 2025 7:48 am    Post subject: Reply with quote

Lester

I have done a preliminary investigation with two conclusions:

1) At the moment the font cannot be preset as I suggested above. We could fix this.

2) We could fix the position of the divide line in order to allow for the subscripts.

I will add this to the task list but I am doubtful about the result being what you would like.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 813
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Tue Feb 11, 2025 11:25 am    Post subject: Reply with quote

Lester,

Here is my approach.

https://www.dropbox.com/scl/fi/j0jx471yw04u6ozv95e1c/Equation.zip?rlkey=qe2j2yodnm264yy002fgvddea&st=l69lb1x9&dl=0
Back to top
View user's profile Send private message
arctica



Joined: 10 Sep 2006
Posts: 146
Location: United Kingdom

PostPosted: Tue Feb 11, 2025 12:02 pm    Post subject: Reply with quote

Thanks for the pointers.

Does Clearwin accept SVG files as input?

Lester
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Tue Feb 11, 2025 1:02 pm    Post subject: Reply with quote

SVG files can be opened and drawn to a "drawing surface" such as that generated via %gr.

See FTN95.chm and search for SVG.

It is under ClearWin+, then Graphics, then Scalable vector graphics.
Back to top
View user's profile Send private message AIM Address
arctica



Joined: 10 Sep 2006
Posts: 146
Location: United Kingdom

PostPosted: Tue Feb 11, 2025 4:51 pm    Post subject: Reply with quote

Thanks for the info Paul.

Shame Clearwin cannot read Inkscape SVG files directly; the structure is slightly different.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Wed Feb 12, 2025 5:30 pm    Post subject: Reply with quote

I had a look at Ken�s example, and there isn�t a need to �print� to PDF, you can capture the screen image with shift-PrintScreen, the paste into Paint and select and cut the bits you want.

Pasting an image file, defined in the Resources section of a program is great if there�s a convenient area to paste it into, say for the legend of a graph axis. In that case you can keep the space for it clear. It isn�t so good if you overlay it on part of a drawing as the white space around the characters obscures what is beneath. In such a case it is a real pity that %eq isn�t better. If it is a regularly repeated display of an equation, you can use something more sophisticated than Paint to make it an icon or a GIF that has transparency. If it is a �one-off�, then the whole rigmarole of making an image file isn�t really appropriate, and similarly if the equation itself has to be scaled.

There is nothing to stop you creating your equation yourself with multiple �passes' for numerator, denominator, subscripts and superscripts etc, but again, a really nice%eq would make that a lot easier.

Incidentally, whatever happened to the Hershey fonts that FTN77 used to have as part of its graphics support?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Thu Feb 13, 2025 7:34 am    Post subject: Reply with quote

It looks like DRAW_HERSHEY@ is exported by salflibc.dll for Win32 but I don't think that I have ever tested it. I presume that the font must be included in the DLL as a resource in order for it to work.

__win_draw_hershey is exported by Clearwin64.dll for x64 but this is just a place holder for possible future development.

If there is a real chance that these functions might be useful then I can investigate further.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Thu Feb 13, 2025 12:38 pm    Post subject: Reply with quote

Hi Paul,

Probably not worth investigating, as it is my interest in archaeology!

Interesting though.

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Wed May 14, 2025 11:08 am    Post subject: Reply with quote

A new option %eq[local_font] has been added and some improvements to the display for %eq have been made for the next release of ClearWin+.

%eq[local_font] will use the current %fn and %ts instead of the default "Times New Roman" with a text size of 2.0.

The improvements provide a reasonable layout of the symbols for this particular equation.

%eq continues to be of limited usefulness and alternatives such as %im are recommended.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Thu May 15, 2025 7:00 pm    Post subject: Reply with quote

Before %eq was working but the results were looking like a disaster. No greek math symbols. Hopefully new local font option will handle that
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Fri May 16, 2025 6:43 am    Post subject: Reply with quote

Hopefully you will see some improvement but although you will be able to use Greek symbols, you will not be able to use both Greek and Roman symbols.

Maybe that could be fixed but I am not sure that it is worth spending much time on this.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8208
Location: Salford, UK

PostPosted: Sat May 17, 2025 11:15 am    Post subject: Reply with quote

It turns out that a number of Greek symbols are already provided as for example {alpha}, {beta}, {gamma}, {delta}, {epsilon}, {phi}, {pi}, {psi}, {zeta}, ... Please see the help file for details.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2923
Location: South Pole, Antarctica

PostPosted: Tue May 20, 2025 1:04 am    Post subject: Reply with quote

Of course this is not of a big concern from the users, but users will come and their priorities may change. Compared to making this compiler more competitive with other Fortran compilers this is minor issue. But if by some reason extending this functionality takes little time who knows may be it is worth to add more sophisticated equation writer.

Currently the HTML based equations on the web finally look good and all browsers support this extension. The FTN77/90/95/Clearwin was supporting some HTML (I even tried to use this for making Help file decades ago). The supported HTML commands were limited at that time and looks like no further development was done after that.

Is it possible to broaden HTML support by linking some open source HTML libraries to FTN95/Clearwin ? Same like 30 years ago was added to this compiler OpenGL and it works with not a single complaint. Or like some other computers added support for external WInAPI, MPI and OpenMP etc ?

If Clearwin ever planned to be rewritten based on HTML/Java so that its windows can be easily resized, posted on the web and controlled from it may be this equation writing would be just the part of this infrastructure, though all the above were probably my crazy dreams
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group