How do you rescale vector widths and message fonts as a plotting panel changes size?
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?
Re: How do you rescale vector widths and message fonts as a plotting panel changes size? -
Wolfgang
182 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.
Re: Re: How do you rescale vector widths and message fonts as a plotting panel changes size? -
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.
Re: Re: Re: How do you rescale vector widths and message fonts as a plotting panel changes size? -
Wolfgang
182 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.