APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Difficulty scaling fonts and vector widths as a plotting panel changes size. post and replies

Return to the Difficulty scaling fonts and vector widths as a plotting panel changes size. thread
Login to post to this thread

How do you rescale vector widths and message fonts as a plotting panel changes size? - August 11, 2016 at 5:31
Stephen Salser
8 Posts

The "Messages" for a plotting panel have a font size that appears to be determined by the "Font Factor".  

Likewise, the vector widths in a VectorField2D are set by the "LineWidth".

Neither of these things changes automatically as the plotting panel is expanded in size or reduced in size.  This causes major problems with appearance, readability, and functionality.

Is there any way to keep track of the plotting panel size so that the "Font Factor" and "LineWidth" can be correspondingly adjusted?


Replies to How do you rescale vector widths and message fonts as a plotting panel changes size?

Re: How do you rescale vector widths and message fonts as a plotting panel changes size? - August 11 2016 9:22
Wolfgang
141 Posts

The plotting panel does not rescale fonts and the stroke width as the panel size changes.  You would need to add this feature to the core code library available on GitHub.  You can download the code here.

https://github.com/OpenSourcePhysics



Re: Re: How do you rescale vector widths and message fonts as a plotting panel changes size? - August 11 2016 2:06
Stephen Salser
8 Posts

Thank you for your advice.  It sounds ambitious for me, but I might give it a try.

Assuming I can figure out how to modify the code, how do I incorporate the modified library into the EjsS work environment?  ( I am using EjsS_5.2.  )


Also, if I did this, I assume that the resulting .ejs projects I create could only be opened and modified using the custom EjsS work environment I have produced.  

This might make is difficult for me to share my .ejs projects with other physics teachers.


Is there any way to access the current size of a given PlottingPanel without modifying EjsS?


Then I could control the line widths and font factors manually.

Thanks again for your help



Re: Re: Re: How do you rescale vector widths and message fonts as a plotting panel changes size? - August 11 2016 2:25
Wolfgang
141 Posts

You can build the osp.jar file using the core OSP library and replace the osp.jar file that is in the bin directory in the EJS workspace.  if your code works, you can make a request to have your changes added to the core.



OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book