Silverfrost Forums

Welcome to our forums

Hershey fonts available for Simpleplot

12 Sep 2014 10:07 #14636

Thanks Agustin. yes, would be nice if Silverfrost will get some sort of new collaboration with D.Butland or even his school students who made amazingly good graphics utility for Android which costs just a dollar on Google Play OR l get the ability to edit the source code.

Otherwise the Simpleplot is dead.

15 Sep 2014 5:17 #14641

John, Good that you have noticed the typo/bug, but good is that %pl is resistant to it. Still attempt to run any second code with %pl crashes it.

15 Sep 2014 9:17 #14642

I'd also appreciate if our Simpleplot hacks 😃 solved one more its problem which makes it an FUglyplot: fonts for LOG scale's exponent. Here is how moronic looks scientific numbering right now: the exponent font is taken as way way too small even after i increased all font sizes. Can you guys fix it with some workaround?

http://s1.postimg.org/i9ifra67z/Log_Expon.png

15 Sep 2014 1:12 #14644

within the limitations of Simpleplot (till Silverfrost contacts David Butland...), the size of the fonts can be changed by means of the proper font used (chset(?) subroutine) or the size of the font (textmg (?) subroutine). I do not remember where I put the following program in the forums, but I resend it here as it will be faster for you to see it. As you will see, CHSET above 20 gives you a larger exponent font.....

program Simpleplot_plots
!requires simpleplot.dll
implicit none
real*4,dimension(70) ::xarr,yarr
integer*4 :: narr,ltype,xscale,yscale
integer*4 :: ctype,i,ans
character(8) :: xlabel='x',ylabel='y'
character(2) :: istr
real*4 :: minx,maxx,miny,maxy

narr=0
do i=1,70
  xarr(i)=2*i
  yarr(i)=i*i
  narr=narr+1
end do
call group(2,2)
DO I=1,30
  ans=i
  call knumb(i,istr)
  CALL AXLBJS('*C','C')
call textmg(1.0)
call axsbtk('XC','I')
call axsbtk('YC','O')
call thckmg('L',2.0)
CALL AXLBJS('**', 'Centre')
minx=minval(xarr)
maxx=maxval(xarr)
miny=minval(yarr)
maxy=maxval(yarr)
xscale=1;yscale=2 !linear scale for x, log scale for y 
CALL SCALES(minx,maxx,xscale,miny,maxy,yscale)
call axcrss('YC',minx)
call pen(2)
ltype=0
ctype=3
call chset(ans)
call cvtype(ctype)
CALL BRKNCV(real(xarr,1),real(yarr,1),narr,ltype)
call pen(4)
CALL AXES7(xlabel, ylabel)
call title7('t','c','Character set '//istr//' ')
end do
call endplt
end program simpleplot_plots

you have of course installed the Hershey fonts as described elsewhere in this forum...

Hope this helps,

Agustin

16 Sep 2014 8:30 (Edited: 17 Sep 2014 11:40) #14647

Agustin, I forgot to mention that this has to be within %pl, I do not use full Simpleplot till it will be fixed and sources controlled by Silverfrost or users (sources opened).

Here is the demo for simplicity (why it produces zero size file 'messages.txt' by the way?)

!------------------------------------------------------- 
 !  Compilation: 
 ! 
 !ftn95 aaa.for /free /debug /no_truncate /undef 
 !slink aaa.obj SIMPLE.DLL            
 ! 
 !------------------------------------------------------- 
 Program simple 

 Real*8 x(100), y(100), z(100), u(100), v(100), w(100) 
 N=100 
 A=20000
 do i=1,N; 
 x(i)=i-1; 
 y(i)=A*sin(i/30.)**2; 
 z(i)=A*sin(i/30.)**5; 
 u(i)=A*sin(i/30.)**10; 
 v(i)=A*cos(i/30.)**10; 
 w(i)=A*sin(i/30.)**2 * cos(i/30.)**2; 
 enddo 
 CALL TEXTMN(0.35) 
 CALL AXLBJS('*C','C') 
 call thckmg('LINE',3.0) 
 call chset(10) 

 i=winio@('%ww%pv%pl[x_axis='Time [s]',y_axis=Amplitude,&      
    &title='U(red, green-analit), U_A on load(orange), I(blue, black-anal)', & 
    & x_array, colour=red, colour=blue, colour=green, colour=black, & 
    &colour=#CC8800, X_ARRAY, SCALE=LOG_LINEAR, N_GRAPHS=5]&',& 
    & 600, 400, N-4, x, y, z, u, v, w) 
 i=winio@('%ac[esc]', 'exit') 
 End 
16 Sep 2014 12:57 #14650

Dan: are you using the Hershey fonts?....I get a nice plot from your code with a not so small exponent numbers......but I setup the Hershey fonts as I explained some messages up in this topic.....and if all runs well, you should produce as part of the Simpleplot output a file named MESSAGES.TXT containing a single line: '(SIMPLEPLOT Mark 2-15(015)D)'......this file, as far as I remember, provides information about the run of the Simpleplot subroutines....

If you already have the Simpleplot.ini file in the Windows folder and the Hershey.dat file in the same folder of Simple.dll, well.....then there is a problem......try to change the numbers in the call 'call chset(10)', for instance to 20, and see what happens...if you still observe the same font, it means that the Hershey fonts were not installed in your system. With CHSET(10) you should get a slanted font....is this your case?

By the way (I didn't see the last message because I was writting mine), colour=#CC8800 works fine for me: I get some kind of light brown curve...is this correct?

Agustin

17 Sep 2014 8:34 #14651

No, i do not see any files called Hershey on my computer.

17 Sep 2014 12:41 #14657

Dan, I've just located an old version of the hershy files and uploaded them to:

norsoftdev.com/hershey.fnt norsoftdev.com/hershey.htm

These are dated 12-May-1995 and 31-Jan-2002 respectively.

REgards Ian

17 Sep 2014 12:46 #14658

I suspected that!....Dan, please, go to the very first message of this topic. There you will see my instructions about how to install them and four or five messages below, you will see a message from Paul that indicates where to find the hershey.dat file as a zip file. Once you have installed them, let us know if you eventually get what you want (or at least more or less what you want considering the limitations of Simpleplot....).

Agustin

17 Sep 2014 9:50 #14659

I changes few hard drives lately and may lost hershey if I installed it (do not remember exactly, plus I was very reluctant to do that, Hershey never looked very good before, only deep despise of utterly bad Simpleplot %pl look which smells like DOS 1.1 may pushed me). The 7.1 definitely does not install that by default. The hack with not centered tic marks worked satisfactory without hershey. If better quality was needed i edited fonts, titles and axis marks by hand but was tired to do that lately with LOG scale. Will see what this new hack gives...thanks.

Meantime, can you post on Postimage dot org or other photo posting place screnshot of axis look from my program above?

How to remove creation of file MESSAGE.TXT? It either crashes %pl or after installing Hershey does not allow second instance of the code to run.

Update: something is still wrong. Changing font from 1 to 20 does not change anything a slightest bit. Same font.

18 Sep 2014 7:00 #14660

I've done everything like it was written. Plz post the image of same axis to compare and see if there is anything worth of trying further

18 Sep 2014 4:55 #14666

using the following code:

Program simple

Real*8 x(100), y(100), z(100), u(100), v(100), w(100)
N=100
do i=1,N;
x(i)=i-1;
y(i)=sin(i/30.)**2;
z(i)=sin(i/30.)**5;
u(i)=sin(i/30.)**10;
v(i)=cos(i/30.)**10;
w(i)=sin(i/30.)**2 * cos(i/30.)**2;
enddo
CALL TEXTMN(0.3)
CALL AXLBJS('*C','C')
call thckmg('LINE',3.0)
call chset(20)
i=winio@('%ww%pv%pl[x_axis='Time [s]',y_axis=Amplitude,scale=log_linear,&     
   &title='U(red, green-analit), U_A on load(orange), I(blue, black-anal)', &
   & x_array, colour=red, colour=blue, colour=green, colour=black, &
   &colour=#CC8800, X_ARRAY, N_GRAPHS=5]&',&
   & 300, 200, N-4, x, y, z, u, v, w)
i=winio@('%ac[esc]', 'exit')
End 

with CHSET(24) I get:

[img][URL=http://s47.photobucket.com/user/agustin_eduardo_bolzan/media/hershey-24_zps900aa07f.png.html]http://i47.photobucket.com/albums/f195/agustin_eduardo_bolzan/hershey-24_zps900aa07f.png[/URL][/img][/code]

and with CHSET(20)

[img][URL=http://s47.photobucket.com/user/agustin_eduardo_bolzan/media/hershey-20_zps1427d665.png.html]http://i47.photobucket.com/albums/f195/agustin_eduardo_bolzan/hershey-20_zps1427d665.png[/URL][/img]

see that I modified your original code for %pl by including a log scale in order to see the font in the case of logarithmic scales.....

As you can see the fine tunning of the plot should be done before calling %pl, almost every Simpleplot subroutine can be used before %pl to have a fine control of the plot. The Hershey fonts work as expected for Simpleplot. If you find that the font does not change by changing the argument in the CHSET subroutine, it means that either simpleplot.ini is not in your windows folder or/and hershey.dat file is not in the same folder of simpleplot.dll.

Hope this helps,

Agustin

18 Sep 2014 7:35 #14668

Quoted from John-Silver Hi Dan, putting: CALL DIAGLV (0) should eliminate the creation of the MESSAGES.TXT file. Will upload the plot I get later when I've done a couple of variants.

John

No, MESSAGES.TXT is a file created by Simpleplot by default and cannot be avoided (sorry Dan!). It is a diagnostic reporting file and the information included there will depend on the use or not of DIAGLV(0,1,2,3,4). If you put DIAGLV just before the call of %pl, and nothing wrong occurs, the file simply says that Simpleplot Mark 2-15 was opened. If you put DIAGLV before any call to Simpleplot subroutines, it should show every call to each subroutine or even the type of device (window, printer, etc. ) opened, if you do not use %pl, or the close of a plot or group of plots.

MESSAGES.TXT has therefore nothing to do with %pl, so that if %pl crashes is not because of the presence of that file, and the problem of a crash when trying to open the same %pl twice, is, from my point of view, a problem of %pl, not Simpleplot.

Respect to the installation of Hershey fonts, they are not installed by FTN95 because they are not included in the distribution as the Hershey.dat file was not in the hands of Silverfrost, and including it now I suspect would imply a modification of the installation procedure as it should also create and install a Simpleplot.ini file. FTN95 includes just the Simpleplot library as a kind of a present for those who needs to plot data without programming a lot, i.e. making plotting...simple. In this sense it is quite cheaper than buying a package of graphics subroutines for Fortran.....but has some limitations......at least till Mr. Silverfrost decides, or not, to update the library with the help of David Butland.....

I think that updating Simpleplot would make FTN95 an even more atractive product for customers because it would be a unique fortran compiler with the facilities of producing very nice Windows UI by means of Clearwin, and generate from simple to very complicated plotting graphs with minimum programing effort, by means of Simpleplot.

just my thoughts,

Agustin

19 Sep 2014 6:03 #14673
  1. Pity i have not mentioned that i changed the demo code to make exactly the same font size as in my axis example, because small and larger fonts harder to compare. Plus when post make sure that posting does not scale the image file. But anyway, the differences in these two examples exist while in any my attempts i do not see any.

  2. How specifically do you compile?

  3. What Windows do you use. Mine is 8.1

  4. Do i need to reboot after those manipulations with installation of hershey? Probably not (and i can not reboot, too much is open on the computer)

  5. any changes in environment variables?

  6. please remind what makes font bold, italic and underlined

UPDATE OK, forget all the above, i found the error. I missed preceding line with the keyword [general] being confused by the words 'So I created a simple.ini file with only the statement'. So the file has actually two statements and my always busy, always in the hurry, tired brain, always translating for me foreign English language too literally-- so i took just one line and omitted the less important one!

(As a sidenote, that's called NLP, neuro-linguistic programming. 😃 All religions are based on NLP, specifically Christianity. After the Bible tells you on two-three pages hundreds of names 'XXX lived 653 year and died. His son YYY lived 336 years and died. Son of his son ZZZ lived 890 years and died...' you are ready for further treatment and consumption and will believe in anything).

Indeed the exponent is larger, though of course the fonts look not good for all scalings, often terrible. Do you also see with font 1,2 the linewidth of plots also changes? But let's see if we find good looking font and good scaling. Yours above look not bad by the way

The only question left - please remind which option makes text bold and italic. Thanks

19 Sep 2014 8:54 (Edited: 20 Sep 2014 10:48) #14674

Thanks John,

That was another good hack! It now allows to run programs simultaneously. Multiple instances of same program are routinely running on my computer. Or just stay till i realize their results. It's like having multiple tabs in the browser.

And the advice of negative fonts was also good, i found the font which looks nice, but unfortunately it is italic. Italic layout hides pixelation of straight fonts.

Playing with Hershey rised the following obvious question: do any antialised Hershey fonts exist in the nature? Why not, what's the problem? That would deliver high quality texts. There also exist a chance that on 4K monitors Hersheys will look without visible defects -- can anyone who has the latest tech try this source below on 4K monitors?

Here is the code for selection of best looking fonts/widths/charsets

!-------------------------------------------------------------------- 
 !  Compilation: 
 ! 
 !ftn95 aaa.for /free /debug /undef 
 !slink aaa.obj 'c:\\Program Files (x86)\\Silverfrost\\FTN95\\SIMPLE.DLL'
 ! 
 ! With thanks to Agustin 'Aebolzan' and John 'John-Silver' 
 !         of the Fortran forum forums.silverfrost.com
 !          for bringing almost dead Simpleplot to life
 !------------------------------------------------------------------- 
 Program simple 
 integer, external :: ActualPlotting

 real*8 TextSize 
 integer LineWidth, iCharacterSetNo
 common /aaa/TextSize, LineWidth, iCharacterSetNo, LWindow

 TextSize = 0.41
 LineWidth = 4
 iCharacterSetNo=-11

 i=winio@('%ww&') 
 i=winio@('%1tl&',16) 
 i=winio@('%sp&',200,250) 
 i=winio@('Text   size   %ta%df%6^rf%ff&', 1d-2, TextSize, ActualPlotting)
 i=winio@('Line Width %ta%dd%6^rd%ff&', 1, LineWidth, ActualPlotting)
 i=winio@('Charset  (-12 to +26)%ta%dd%6^rd%ff&', 1, iCharacterSetNo, ActualPlotting)
 i=winio@('%cn%^tt[Re-Plot]&',ActualPlotting) 
 i=winio@('%ac[esc]', 'exit') 
 end
!---------------------------------------------------------------------------
 integer function ActualPlotting ()

 real*8 TextSize 
 integer LineWidth, iCharacterSetNo
 common /aaa/TextSize, LineWidth, iCharacterSetNo, LWindow


 Real*8 x(100), y(100), z(100), u(100), v(100), w(100) 

 N=100
 A=20000  
 do i=1,N; 
 x(i)=i-1; 
 y(i)=A*sin(i/30.)**2; 
 z(i)=A*sin(i/30.)**5; 
 u(i)=A*sin(i/30.)**10; 
 v(i)=A*cos(i/30.)**10; 
 w(i)=A*sin(i/30.)**2 * cos(i/30.)**2; 
 enddo 

 CALL DIAGLV (0)
 CALL TEXTMN(sngl(TextSize)) ! 45) 
 CALL AXLBJS('*C','C') 
 call thckmg('LINE', float(LineWidth)) 
 call chset(iCharacterSetNo) 

 LWindow = 0
 call window_update@(LWindow)

 i=winio@('%ww%pv%pl[x_axis='Time [s]',y_axis=Amplitude,&      
    &title='U(red, green-analit), U_A on load(orange), I(blue, black-anal)', & 
    & colour=red, colour=blue, colour=green, colour=black, & 
    &colour=#CC8800, X_ARRAY, SCALE=LOG_LINEAR, N_GRAPHS=5]&',& 
    & 900, 600, N-4, x, y, z, u, v, w) 
 i=winio@('%ac[esc]&', 'exit') 
 i=winio@('%lw', LWindow) 

 ActualPlotting = 2
 End function

http://s8.postimg.org/9aohszm6t/041_3_min12.png

19 Sep 2014 1:33 #14676

Quoted from John-Silver Re- MESSAGES.TXT - well for me it worked !

I added a line with CALL DIAGLV (0) and the MESSAGES file was not produced !

you are right!......it seems that I put the DIAGLV call in a wrong place.....now I get the same results as you: no MESSAGES.TXT!

and very nice program Dan!.....I like your code for checking the properties of lines and fonts in a plot......I have changed your %ac for a simple %bt that just 'exits' the window.....and about using antialiased Hershey fonts...well, I think the problem is not if they exist or not, but how to implement them in CHSET.....this subroutine uses the Hershey.dat file, I guess this file should be changed for that....but this is a question for.....guess who?.....David Butland!......

Agustin

19 Sep 2014 6:38 #14677

Agustin, Just noticed that this code has some bug i couldn't immediately fix - it crashes when resized with the error message 'Invalid data value supplied to %pl'. Usually %pl resizes with no problem which means i made a mistake somewhere

Just the information on what's to add to %pl in future: found the article in one journal which has all figures resembling Simpleplot style.

http://s25.postimg.org/7ibw9to9b/Image28.png

http://s25.postimg.org/l0ism40en/Image31.png

http://s25.postimg.org/ex1827a4v/Image5.png

19 Sep 2014 8:32 #14678

Dan, I do not know to what extend do you want %pl be improved. I have not a great expertise in programming, but to me it appears that trying to make %pl a very powerful tool (with the same or similiar possibilities as Simpleplot) for making graphs would turn it into something difficult to code and at some stage difficult to understand (or follow).....I guess that using a list of calls to subroutines, each one producing some particular part of a graph, is still better, but perhaps I am wrong....probably Paul could enlighten us in this respect....

I would also say that at this stage, the use of Simpleplot under FTN95 is not straightforward as we have seen along all our discussions under this and some other topics....therefore, what I would expect, if Silverfrost considers that the inclusion of Simpleplot in the distribution is really a valuable tool, is that they:

  1. include the installation of Simpleplot really as part of FTN95, i.e. the installation of Simple.ini and Hershey fonts along with the compiler.
  2. include a help file for Simpleplot, as we already have for Clearwin, so that people could use it easily by accesing to the description and use of each subroutine.
  3. improving Simpleplot with the help of David by updating what needs to be updated (real*8 variables?) and solving the problems with fonts (and symbols....the list of symbols in Simpleplot is not at the level of publications nowadays).
  4. including the information and examples about how to use Simpleplot with Clearwin.

The main problem I see is that Silverfrost seems to be saying: 'if you like, here is something called Simpleplot, but we have nothing to do with it and we will say nothing about it...', and consequently the lack of promotion to the users of FTN95 makes Simpleplot to rest in peace in the web site....until somebody starts to search for a Fortran library fro plotting graphs......and then you can go an buy something like GINOGRAF or use the free Simpleplot.....

just my thoughts,

Agustin

19 Sep 2014 8:49 #14679

Quoted from aebolzan Dan, I do not know to what extend do you want %pl be improved...

I want very simple thing which by the way sells from the point of view of promoting this compiler too:

  1. Matlab graphics simplicity - essentially plotting in one single line of fortran text, which is already possible
  2. Nature/Science/Physical Review journal quality. Matlab is capable of that, Simpleplot just needs some cosmetic work.

By the way, most of the absent features (like those on figures from journal above) can be added to %pl in a week of work without hurting its simplicity

For me any serious use of full Simpleplot will be an option if Silverfrost or all users control its source and development or have the rights to change it. Like with some other graphics packages -- Dislin or Simdem. Meantime developers at least need to fix the bugs and obvious deficiencies. Right now Simpleplot is still a dead end product (i do not know status of communications of developers)

20 Sep 2014 5:57 (Edited: 21 Sep 2014 3:23) #14681

John,

You are right, the font -11 is as good as -12 in pixelation, i missed it taking some wrong sizes. Both though have the same defect: too small font for exponent

For color #RRGGBB you need latest DLL/LIB files from version 7.1

I edited the code, the button is used just to re-plot in case you need that. Spin wheel closes windows automatically. Or esc key

Differences in scaling between my and your images are probably due to screen pixel counts dimensions of our computers. I suspect all scales will change on future 4K monitors.

As to posting images, i use Postimage dot org, ask it do not rescale and take 'Direct Link' it offers. I insert it in the text same way as you do adding two img tags (same will do the forum's own button 'Img' above using Javascript, so make sure it is not switched off)

Of course it will take a lot of thinking and time to make Simpleplot perfect, to add many new options, select the best ones as a default etc but to change the obvious faults with the centering tics, add standard Windows fonts, 4-axis surface area, better scalability when the size goes to thumbnail dimensions, ability to run multiple %pl windows in the same screen, fix few tic mark/labeling defects, rebuild al to 24bit color paletttes for 3D plots in demo instead of 4 bit, all probably will not take too much time, most is already done, it just sometimes looks ugly, the Simpleplot was done 20 years ago and was not updated. To make me 99% satisfied not actually very much more is needed. D.Butland perfectly knows what is wrong with the look, feel and design of Simpleplot, even his school age kids made Android graphics software Bridplot which looks absolutely amazing, have you seen that?

The way you guys discovered when full Simpleplot helps %pl to expand its functionality should be primary design concept of future Simpleplot.

Thanks for more useful tips! I added margin change to the code so anyone can adjust the margin now or just play with it (and see it like everything in Simpleplot also has room for improvement and exposes some Simpleplot defects - in my case for example adding it messes with the font for exponent decreasing it even further, axis titles jump out etc. What units are used for margin adjustment? It is definitely not the % of plotting area which is needed for proper scaling of graph if resizing). I hope you guys will find new Simpleplot bug which messes with the exponent font but opposite way and return larger exponent font back 😃

And i found the crashing code bug when resizing - Simpleplot conflicts with %lw. Commenting this line makes it re-sizable fine but loses ability to auto-close the window

Simpleplot = huge_bugotron made in the era of unfamous FTN90, the champion of bugotrons. Needs some maintenance work ASAP

Please login to reply.