Questions tagged [qfont]

32 questions
1
vote
1 answer

Get font family name from QFontDatabase::addApplicationFont

I'm using QFontDatabase:addApplicationFont, and it's working as intended, but I want to get the family font name from the last ttf file it loads up, since the intended use of it is letting the user use whatever font they point towards. I mostly want…
Uri
  • 25
  • 1
  • 7
1
vote
1 answer

How to set dynamic QFont size?

I came across QFontMetrics? http://doc.qt.io/qt-5/qfontmetrics.html This gives the height and width of the present font. I need to run my application with full screen mode on on different monitors for which I am using Scale class.…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
1 answer

QML TextEdit font.preferShaping not matches QFont::PreferNoShaping

I have QML component with TextEdit: TextEdit { ... font: settings.myFont font.preferShaping: false when load the component I get error qml Can't create component : Property has already been assigned a value pointing to…
Vladimir Bershov
  • 2,701
  • 2
  • 21
  • 51
0
votes
0 answers

Problem integrating QFontComboBox in Qmenu

I'm trying to integrate QFontComboBox within Qmenu. I try to make two things happen when selecting a particular font from the menu: The Qmenu will close. print the selected font. from PyQt5.QtCore import QObject from PyQt5.QtGui import QIcon,…
ROOMBON
  • 1
  • 1
0
votes
0 answers

QFontMetrics::horizontalAdvance() returns inconsistent results

I'm working on a function that determines the maximum number of characters that can fit in a given width (in pixels) based on the widest character in the string and then chops the string accordingly. I'm using the horizontalAdvance method of…
Nihilish
  • 105
  • 1
  • 16
0
votes
1 answer

Qt how to set QFont weight I want

For example, I want set the QFont weight 120 pixels or 1.5mm. Now, the weight has been defined by enumeration of 0~99, that's not my need. I upload two images for example: normal text expand text
0
votes
1 answer

QPdfWriter not embedding standard fonts properly since Qt 6.0.0

Since switching to QT 6.0.0 I got problems with QPdfWriter. Every Time I try to print a text, the embedded font couldn't get loaded from various pdf reader (even Adobe reader). I'm as well not getting any errors or anything else on the…
ratloser
  • 116
  • 1
  • 7
0
votes
1 answer

Setting QFont from QFontDatabase sets all labels to monospaced font? Qt C++

I am trying to set one QLabel to a monospaced font. By default, I have all my other labels set to "Arame-Regular" in the designer. Normally, trying to set any of my labels to "Arame-Mono" (the monospaced font) in the designer does not work. They…
956MB
  • 135
  • 2
  • 12
0
votes
0 answers

QApplication setFont() and QTimer

When I setup font for Qt application, it has no effect on the part of code executed on QTimer's timeout() signal. main.cpp #include "mainwindow.h" #include #include #include int main(int argc, char…
swapfs
  • 1
  • 2
0
votes
1 answer

Qt/ Qml Frobihser font behaving differently in Linux and Windows environment

I have written a qtquickapplication sample program to display a text "none" within given rectangle. Rectangle border color is set to red to visualize whether text "none" is fitting properly within given width and height or not. I have compiled same…
RaviS Gupta
  • 95
  • 2
  • 11
0
votes
1 answer

Font Rendering difference in windows and Linux, Qt Cpp

I have, QFontMetrics m_fm(QFont("Arial",14)); and m_fm.width("Existing LAN IP Address from Project Network"); returns '297' (on windows) can anyone tell me what it returns on linux compiler? and if its different on linux then why so? and how…
karan chavan
  • 215
  • 2
  • 12
0
votes
0 answers

QML Arabic font rendering incorrectly in iOS

There seems to be difference in font rendering with QML in ios and android as given below This one is correctly rendered in android Please check the difference in ios. Here its showing incorrectly. Do i have to do anything different in iOS for…
Husni Abdul Nazer
  • 103
  • 1
  • 1
  • 12
0
votes
0 answers

How do I auto resize the font used in labels of the UI form in qt, according to resolution?

I am currently developing an application. And my development computer resolution is 1366*768, I know how to make the application size auto resizable according to resolution. But the problem is in the labels used in application. If the resolution of…
Gurushant
  • 952
  • 6
  • 23
0
votes
1 answer

drawText with two variables and each different font

I dont know if its possible to chose different text font for each variable inside the same painter. painter.drawText(80, 290, self.text1.text() + self.text2.text()) This is the example: for text1 want to leave it default as I set in the painter…
koki
  • 35
  • 7
0
votes
1 answer

Can QFontMetrics account for windows dpi scaling?

I was under the impression that if you do this in your application QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication* app = new QApplication(temp, NULL); then Fonts gets automatically scaled up on high resolution display.…
Octo
  • 543
  • 1
  • 5
  • 16