Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 3623  / 1 Year ago, fri, april 14, 2023, 6:22:03

I installed the Unity Editor on my Thinkpad x1 Carbon, which has a resolution of 2560 x 1440, and is considered HiDPI. In order to deal with very small font sizes, I installed gnome-tweak-tools and set my Fonts Scaling Factor to 1.34. This has resulted in an acceptable font size in every application I have tried so far, with some tweaks in programs like Firefox.



However, the Unity Editor doesn't have a font size modifier for its UI. It looks like this on my machine:



Screenshot of Unity Editor on a Thinkpad x1 Carbon running Ubuntu 18.04 with Gnome



The font size is unreadably small.



I see that under gnome-tweak-tools, I can set font sizes specifically for things such as "Window Title" or "Document," but not, for example, "Unity Editor."



I could set "Scaling Factor" very high but this makes other programs have unacceptably large fonts.



I could modify, under the regular Settings app, under Displays, the Scale property, from 100% to 200%, but this makes every other application have a terribly bloated, nearly unusably large UI.



How can I change the font size for only one application, specifically, Unity Editor?



EDIT: By the way, there does not appear to be any intention on the Unity Editor engineering team to implement a font size changer: https://forum.unity.com/threads/how-to-change-font-size-in-unity-editor.149481/


More From » 18.04

 Answers
2


Create a script call ue (Unity Editor). Place within it:



#!/bin/bash
xrandr --dpi 144
unity-editor "$@" # Or whatever the program is you want to run


Mark the script as executable using:



chmod a+x ue


Call the script using



./ue



  • Or replace ./ with the directory name if not in the current directory

  • Or leave off ./ if you have placed ue in your $PATH like ~/bin or /usr/local/bin



Adjust 144 to 192 if you want it double magnification. Smaller if you want less magnification.



Your screen may blink when script starts up but that is normal.






TL;DR



The default DPI (Dots Per Inch) is 96. When set to 100 font size increased by 4% which might not be noticeable. To confirm initial DPI use one of these commands:



$ xdpyinfo | grep dots
resolution: 96x96 dots per inch

$ grep DPI /var/log/Xorg.0.log
[ 9.555] (--) NVIDIA(0): DPI set to (43, 44); computed from "UseEdidDpi" X config
[ 9.761] (==) modeset(G0): DPI set to (96, 96)


In the above script you can reset xrandr back to default DPI of 96 by adding the following line to the bottom:



xrandr --dpi 96


I've never encountered a need to do this, but you might.


[#5234] Sunday, April 16, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mentpengu

Total Points: 148
Total Questions: 114
Total Answers: 119

Location: Anguilla
Member since Sun, Aug 7, 2022
2 Years ago
;