Skip to main content

Java apps fonts too big


 This was happened when I first tried to run SweetHome3D Portable. As it was a portable software, I didn't want to be bothered by installing it. The apps was running, but as you can see at the picture above, the fonts were way too big on my screen.

The original bash script for running the app was:

exec "$PROGRAM_DIR"/runtime/linux/x64/runtime/bin/java -Xmx1024m -classpath "$PROGRAM_DIR"/lib/SweetHome3D.jar:"$PROGRAM_DIR"/lib/Furniture.jar:"$PROGRAM_DIR"/lib/Textures.jar:"$PROGRAM_DIR"/lib/Examples.jar:"$PROGRAM_DIR"/lib/Help.jar:"$PROGRAM_DIR"/lib/batik-svgpathparser-1.7.jar:"$PROGRAM_DIR"/lib/jeksparser-calculator.jar:"$PROGRAM_DIR"/lib/iText-2.1.7.jar:"$PROGRAM_DIR"/lib/freehep-vectorgraphics-svg-2.1.1c.jar:"$PROGRAM_DIR"/lib/sunflow-0.07.3i.jar:"$PROGRAM_DIR"/lib/jmf.jar:"$PROGRAM_DIR"/lib/java3d-1.6/j3dcore.jar:"$PROGRAM_DIR"/lib/java3d-1.6/j3dutils.jar:"$PROGRAM_DIR"/lib/java3d-1.6/vecmath.jar:"$PROGRAM_DIR"/lib/java3d-1.6/gluegen-rt.jar:"$PROGRAM_DIR"/lib/java3d-1.6/jogl-java3d.jar:"$PROGRAM_DIR"/lib/jnlp.jar -Djava.library.path="$PROGRAM_DIR"/lib/java3d-1.6/linux/amd64:"$PROGRAM_DIR"/lib/yafaray/linux/x64 -Djogamp.gluegen.UseTempJarCache=false -Dcom.eteks.sweethome3d.preferencesFolder="$PROGRAM_DIR"/data -Dcom.eteks.sweethome3d.applicationFolders="$PROGRAM_DIR"/data -Dcom.eteks.sweethome3d.deploymentInformation=portable -Dcom.eteks.sweethome3d.applicationId=SweetHome3D#Portable com.eteks.sweethome3d.SweetHome3D -open "$1"

 Add this part:

 -Dcom.eteks.sweethome3d.deploymentInformation=portable -Dcom.eteks.sweethome3d.resolutionScale=1 -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel -Dswing.plaf.metal.controlFont=Dialog-12 -Dswing.plaf.metal.userFont=SansSerif-12 -Dswing.plaf.metal.systemFont=SansSerif-12 

So it'll become:

exec "$PROGRAM_DIR"/runtime/linux/x64/runtime/bin/java -Xmx1024m -classpath "$PROGRAM_DIR"/lib/SweetHome3D.jar:"$PROGRAM_DIR"/lib/Furniture.jar:"$PROGRAM_DIR"/lib/Textures.jar:"$PROGRAM_DIR"/lib/Examples.jar:"$PROGRAM_DIR"/lib/Help.jar:"$PROGRAM_DIR"/lib/batik-svgpathparser-1.7.jar:"$PROGRAM_DIR"/lib/jeksparser-calculator.jar:"$PROGRAM_DIR"/lib/iText-2.1.7.jar:"$PROGRAM_DIR"/lib/freehep-vectorgraphics-svg-2.1.1c.jar:"$PROGRAM_DIR"/lib/sunflow-0.07.3i.jar:"$PROGRAM_DIR"/lib/jmf.jar:"$PROGRAM_DIR"/lib/java3d-1.6/j3dcore.jar:"$PROGRAM_DIR"/lib/java3d-1.6/j3dutils.jar:"$PROGRAM_DIR"/lib/java3d-1.6/vecmath.jar:"$PROGRAM_DIR"/lib/java3d-1.6/gluegen-rt.jar:"$PROGRAM_DIR"/lib/java3d-1.6/jogl-java3d.jar:"$PROGRAM_DIR"/lib/jnlp.jar -Djava.library.path="$PROGRAM_DIR"/lib/java3d-1.6/linux/amd64:"$PROGRAM_DIR"/lib/yafaray/linux/x64 -Djogamp.gluegen.UseTempJarCache=false -Dcom.eteks.sweethome3d.preferencesFolder="$PROGRAM_DIR"/data -Dcom.eteks.sweethome3d.applicationFolders="$PROGRAM_DIR"/data -Dcom.eteks.sweethome3d.deploymentInformation=portable -Dcom.eteks.sweethome3d.resolutionScale=1 -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel -Dswing.plaf.metal.controlFont=Dialog-12 -Dswing.plaf.metal.userFont=SansSerif-12 -Dswing.plaf.metal.systemFont=SansSerif-12 -Dcom.eteks.sweethome3d.applicationId=SweetHome3D#Portable com.eteks.sweethome3d.SweetHome3D -open "$1"

And voila! Here's the result:


Comments

Popular posts from this blog

Yarn Pubkey Error

Sistem update software di laptopku tiba-tiba error (minor) dengan pesan: The following signatures were invalid: EXPKEYSIG 23E7166788B63E1E Yarn Packaging <yarn@dan.cx> Solusi

Installing RAR Extension on PHP 8.3

 One of the app I'm working requires RAR extension on PHP. Unfortunately the latest RAR version doesn't work on the PHP version installed on my machine (PHP 8.3). Searching the forum for a few minutes gave me this solution: 1. Install php-dev (phpize) if it isn't installed yet 2. Get the extension from cataphract git clone https://github.com/cataphract/php-rar 3. Configure and install cd php-rar/ phpize ./configure && make && sudo make install 4. Load it to PHP (I'm using PHP-FPM) echo '; configuration for php rar extension'|sudo tee -a /etc/php/8.3/mods-available/rar.ini > /dev/null echo 'extension=rar.so'|sudo tee -a /etc/php/8.3/mods-available/rar.ini > /dev/null sudo ln -s /etc/php/8.3/mods-available/rar.ini /etc/php/8.3/fpm/conf.d/20-rar.ini 5. Restart the PHP-FPM sudo systemctl restart php8.3-fpm And here is the result