当前位置:网站首页>QML fonts use pixelsize to adapt to the interface
QML fonts use pixelsize to adapt to the interface
2022-07-08 01:43:00 【Fu_ Lin_】
Preface
Has been plagued by the problem of font adaptation , Especially in use pixelSize Unit font , Different effects will be displayed on computers with different resolutions , Some are big , Some are medium , Some thieves are small , This is because of the use of pixelSize It will cause the font to be fixed , How big is most , It won't change by itself , When it comes to high resolution, it becomes smaller , The low one is the thief , Just like the design prototype , It looks very beautiful .
While using pointSize Although it will zoom in and out by itself , But there is a big gap with the font of the design , And there will be corresponding problems , And I prefer to use pixelSize, Now that it's fixed , I can zoom in and out by myself according to the proportion , So the key point of this paper is how to obtain the zoom in and zoom out ratio , Make pixel fonts look medium good on any device !
Ideas
To get the font scaling factor , You have to know that the width and height of the original pixels are compared with the original pixels of the current device , Get different width height ratio values , Get the minimum , This is the scaling factor , Then multiply by the current font size , You can scale the font proportionally , Of course, you can also add a scaling base factor , Initialize to 1, This needs artificial adjustment , There may be 1 Not very good. , It needs to be adjusted to 1.1 It will be better , The specific acquisition code is given below
horizontalRatio = Changing U边栏推荐
- ANSI / NEMA- MW- 1000-2020 磁铁线标准。. 最新原版
- NPM Internal Split module
- PHP to get information such as audio duration
- LeetCode 练习——剑指 Offer 36. 二叉搜索树与双向链表
- Anaconda3 download address Tsinghua University open source software mirror station
- ArrayList源码深度剖析,从最基本的扩容原理,到魔幻的迭代器和fast-fail机制,你想要的这都有!!!
- 不算不知道,花呗分期的真实利率居然这么高
- 滑环使用如何固定
- Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
- common commands
猜你喜欢

Matlab code about cosine similarity

城市土地利用分布数据/城市功能区划分布数据/城市poi感兴趣点/植被类型分布

第七章 行为级建模

从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值

2022 examination for safety production management personnel of hazardous chemical production units and new version of examination questions for safety production management personnel of hazardous chem

Guojingxin center "friendship and righteousness" - the meta universe based on friendship and friendship, and the parallel of "honguniverse"

Redux usage

The foreach map in JS cannot jump out of the loop problem and whether foreach will modify the original array

生态 | 湖仓一体的优选:GBase 8a MPP + XEOS

Redis集群
随机推荐
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
AttributeError: ‘str‘ object has no attribute ‘strftime‘
qt--將程序打包--不要安裝qt-可以直接運行
Voice of users | winter goes and spring comes, waiting for flowers to bloom -- on gbase 8A learning comprehension
Anaconda3 download address Tsinghua University open source software mirror station
5、離散控制與連續控制
用户之声 | 冬去春来,静待花开 ——浅谈GBase 8a学习感悟
第七章 行为级建模
qt-使用自带的应用框架建立--hello world--使用min GW 32bit
About snake equation (5)
Tapdata 的 2.0 版 ,開源的 Live Data Platform 現已發布
The solution of frame dropping problem in gnuradio OFDM operation
Codeforces Round #649 (Div. 2)——A. XXXXX
Codeforces Round #633 (Div. 2) B. Sorted Adjacent Differences
Gnuradio operation error: error thread [thread per block [12]: < block OFDM_ cyclic_ prefixer(8)>]: Buffer too small
Redis cluster
regular expression
Codeforces Round #643 (Div. 2)——B. Young Explorers
body有8px的神秘边距
QT build with built-in application framework -- Hello World -- use min GW 32bit