New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font tiny on high DPI screen (3840 x 2160) in Windows 10 (v 19.2) #19
Comments
Hi @dr3x, Manifest-Version: 1.0
Main-Class: tim.prune.GpsPrune the resulting file will be here: |
The issue about the high-dpi screens sounds very similar to issue 16: #16 - maybe you can find some suggestions in there. Currently I don't know how to solve it (but I don't think that supporting map tiles of two different sizes is the right approach). Regarding a "pom.xml", I believe that's something to do with Maven, is that what you are using? If you're familiar with Maven and are able to create such an xml file then I'd be delighted to publish it. I don't believe it would be very complex, because GpsPrune only has one build-time dependency to Java3d. So it would either just specify "Java3d please" or it would specify "j3dcore, j3dutils and vecmath jars please". If you can tell me which "one of the forks" you mean which supplies a pom.xml then maybe I can adapt theirs. Or if you don't want the 3d parts then just cut them out and you shouldn't need anything in your pom.xml I'd have thought. As ptanov says, there is a build script available too, included in the source tarball, but this only finds the jars in your classpath so may need to be manually extended to include the three 3d jars, depending on where you have them and what they're called. If you need more details on how to build, please supply details about your system (I guess Windows 10?), which JDK and whether or not you have java3d installed. |
I was able to get it working with a (slightly modified) pom.xml that I found on a fork of your code (https://github.com/ta-apps/GpsPrune). That fork has tim/prune relocated under the src folder. I put my code out on the working branch of my fork (https://github.com/dr3x/GpsPrune/tree/working) in case anyone is interested. It may not be simple to just pull in that pom.xml due to the changed directory structure. Since I was able to run the app with my modified source (and it didn't have unusable tiny font) and do what I wanted (fixup my Strava data for one event) I didn't go further with it. I may try @ptanov 's technique of bash script + manifest in the future. But I think if you update the master to make it easier to pull down and compile from source you may get more contributions. Thanks! My environment: Windows 10 Pro, Visual Studio Code v1.33.1, JRE build 1.8.0_201-b09, Open JDK 11.0.2, and no Java3d |
Hello again, |
@dr3x that sounds great, could you please point me to the bit(s) of your changes which solve the font issue for you? It would be great if I could merge this fix somehow. I'm hoping there's a way to make the display readable for everybody, no matter what their dpi is. |
@ptanov that also sounds very interesting (and maybe this should be a separate issue). I know nothing about Maven, so some of these questions may sound foolish, sorry in advance! When I read about Maven on wikipedia, it explains that all projects have to follow a certain folder structure, with all code under src/main/java/ and all resources under src/main/resources/. Yet @dr3x has it working with code under src/ and you have shown that it also works with code at the root. So what is necessary for Maven, and what is recommend / usual? None of the other ways to build GpsPrune (throwing code into an IDE, running a .sh, using ant) care about the folder structure this much. Does Maven also want the translation files (resources) under src/main/resources rather than under prune/lang/ ? I would be keen to avoid introducing extra build problems for other builders who don't use Maven, of course. When I tried your xml, Maven downloaded java3d stuff from the maven repositories, even though I already have java3d installed - that's not a big problem but quite a difference to other build methods. Then I get a jar file, but when I run that with "java -jar" it can't find those java3d bits which maven downloaded, so I get no java3d at runtime. Is there a way around that, or do I have to manually specify the location of where maven downloaded the requirements from? Do I have to run GpsPrune through Maven? And lastly, in your pom.xml you have what look like thirteen different version numbers specified for various plugins with the comment "lock down plugins versions to avoid using Maven defaults", is this going to cause a maintenance issue when so many version numbers need to be maintained? I would expect the pom.xml to be almost trivially simple, just saying "I need java3d version x". I haven't tried the eclipse:eclipse method yet, I'll try this out and see what happens. Thanks again for this great contribution! |
@activityworkshop to be clear I'm not a Java/maven guy; it has been years since I've worked with those technologies. I was able to build from the fork after commenting out one reference to a library that I didn't have access to (and it built successfully without it). When I ran it, it no longer had the tiny font issue. So I didn't actually make any changes related to the font issue. Here's a response to my questions I got from a member of the team that created the pom.xml on the fork:
|
@ptanov cloned and built your pull request and it works for me (except for 3d but that might just be my config) @activityworkshop can you point me to how to enable 3d? I get the message "This function requires the Java3d library" when I invoke 3d from the menu. I installed Java 3d 1.5.1 (latest, didn't find the 1.3.1 listed in the pom) |
<resources>
<resource>
<directory>${project.basedir}/</directory>
<includes>
<include>tim/prune/gui/images/*</include>
<include>tim/prune/lang/*</include>
<include>tim/prune/function/srtm/srtmtiles.dat</include>
<include>tim/prune/*.txt</include>
</includes>
</resource>
</resources> So this is a quick workaround - Maven is introduced without breaking the backward compatibility. Although I recommend using
The problem with java3d is that it contains native libraries that need to be available in the host. There are few options:
Actually I haven't tried 3D functionality in GpsPrune. Unfortunately the version 1.3.1 is not available at https://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html#java3d-1.5.1-oth-JPR so I changed the Java 3D version to 1.5.1 (pom is updated). Now I can use the 3D functionality in GpsPrune using Back to the problem
No, running using Maven (
These are versions of the Maven plugins that are used for building the project, not the versions of the libraries used by the project itself. They are used to configure different aspects of the build (how to store resources in the resulting jar, what to execute by default when
hmm, probably the problem is not on your side (...sorry :( ) - check the comments above (I have updated the pom). |
@ptanov tried with the updated pom and it compiles and runs but Java 3d still not working. I do have the Java 3d v1.5.1 (x64) installed on my system. Let me know if there's anything else to try |
Hi @dr3x, You can add logging (e.g. How did you installed Java 3D on you machine? There are installation instructions (https://download.java.net/media/java3d/builds/release/1.5.1/README-download.html) but I can't test it (I don't have Windows). |
For me the use of Maven would be useful for two purposes - building a jar which then works including its dependencies, and possibly also constructing an Eclipse project also connected to its dependencies. For me, Maven does neither of those things properly. This could be just my unfamiliarity with it of course! As noted above, if it builds the jar using its own downloaded java3d packages (which it put in its own "M2" repository), then to run it I would have to also specify those "M2" jars. But as you say those aren't connected to native code (I don't think) so instead I would have to run the jar together with my installed java3d components. Which may or may not be compatible. But Maven can't specify those in the jar manifest because it doesn't know anything about them, that's why it uses its own versions. So I'm not sure how this is supposed to work properly. Then I tried the "eclipse:eclipse" target to create an Eclipse project, but this project fails to build with errors like "Unbound classpath variable: 'M2_REPO/java3d/j3d-core/1.3.1/j3d-core-1.3.1.jar' in project 'GpsPrune-master'" so I guess some configuration is missing? In any case it's much easier to just create a project in Eclipse, throw the GpsPrune code into it and then add the java3d jars as dependencies, so I don't think Maven is helping me very much here. For runtime linking to java3d you can use the jars created by Debian or Ubuntu as a reference, they include the classpath to the installed java3d libraries in the manifest.mf file of GpsPrune. But this is possible because Debian and Ubuntu know where the java3d components are installed to. For obvious reasons I don't do this with the jars which I publish, because I've got no idea where the java3d components are on the target machine. |
I'm not sure whether I understand you correctly about jar creation. Maven can be configured to include all jars or/and configure the classpath in About Eclipse - sorry I forgot to mention Btw one benefit of using Maven is that it is a common tool for Java development, developers are familiar with it and as @dr3x mentioned:
|
I completely agree. (2) - Provide a (3) - Support gradle for those who use that. Again, this would make it easier for those who are already familiar with gradle to get building immediately. I decided not to take the proposed edits to the So now I think I've addressed all the concerns about making it easier for people to build and contribute. If you have any other concerns or suggestions along those lines then please send them in, perhaps using a new issue. The original subject of this issue was fonts being tiny on high-dpi screens, which I haven't been able to address at all yet - any help on this would be very welcome! |
I think most of the issues discussed here are resolved, apart from the high-dpi screen issue which is covered by #16 . |
Unusable on my default display setting; have to reset the display to use it.
Pulled the source to see if I could tweak the settings but didn't have everything needed to compile.
Is there a pom.xml file for this project? I'm not a Java guy but don't you need some config to bring in all the dependencies?
Was able to get one of the forks to compile but they created a pom file and also relocated tim/prune under a src folder so the structure is different.
The text was updated successfully, but these errors were encountered: