View previous topic :: View next topic |
Author |
Message |
arctica
Joined: 10 Sep 2006 Posts: 146 Location: United Kingdom
|
Posted: Mon Feb 10, 2025 2:35 pm Post subject: Formatting equations |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Mon Feb 10, 2025 5:35 pm Post subject: |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Feb 11, 2025 7:48 am Post subject: |
|
|
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 |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 799 Location: Hamilton, Lanarkshire, Scotland.
|
|
Back to top |
|
 |
arctica
Joined: 10 Sep 2006 Posts: 146 Location: United Kingdom
|
Posted: Tue Feb 11, 2025 12:02 pm Post subject: |
|
|
Thanks for the pointers.
Does Clearwin accept SVG files as input?
Lester |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Tue Feb 11, 2025 1:02 pm Post subject: |
|
|
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 |
|
 |
arctica
Joined: 10 Sep 2006 Posts: 146 Location: United Kingdom
|
Posted: Tue Feb 11, 2025 4:51 pm Post subject: |
|
|
Thanks for the info Paul.
Shame Clearwin cannot read Inkscape SVG files directly; the structure is slightly different. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Wed Feb 12, 2025 5:30 pm Post subject: |
|
|
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 |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Thu Feb 13, 2025 7:34 am Post subject: |
|
|
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 |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Thu Feb 13, 2025 12:38 pm Post subject: |
|
|
Hi Paul,
Probably not worth investigating, as it is my interest in archaeology!
Interesting though.
Eddie |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8177 Location: Salford, UK
|
Posted: Wed May 14, 2025 11:08 am Post subject: |
|
|
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 |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2910 Location: South Pole, Antarctica
|
Posted: Thu May 15, 2025 7:00 pm Post subject: |
|
|
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 |
|
 |
|