Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. font
    Log in to post

    • SOLVED Custom font for whole application
      General and Desktop • font qrc font family custom font • • DeanLee  

      3
      1
      Votes
      3
      Posts
      159
      Views

      So, after long time, finally I can fix it. I don't know why, but *.ttf font file is works fine. Qt says support both otf and ttf file, but it's not.
    • SOLVED <font family> gets removed from .ui header files after upgrading Qt Creator from v5 to v6 ?
      General and Desktop • font fonts qfont font family • • R-P-H  

      21
      0
      Votes
      21
      Posts
      638
      Views

      @ChrisW67 Really so hard the read the bug report and what I wrote? It is fixed in 6.2.3 and 6.3.x ...
    • SOLVED How to use a custom font in Qt Installer Framework?
      General and Desktop • font qt installer custom font qtinstaller • • SamurayH  

      2
      0
      Votes
      2
      Posts
      157
      Views

      Ok I've solved it. It was my fault, the -r parameter must have a list of Qt Resource files.. I got a bit confused with the fonts/ path, I though it was a folder but it's a prefix path a Qt Resource file (.qrc): <RCC> <qresource prefix="/fonts"> <file>MyFont.TTF</file> </qresource> </RCC> and the command: binarycreator -c config\config.xml -p packages -r resources/rc.qrc MyAppSetup.exe
    • SOLVED Blurry and strange color when creating barcode using fonts
      General and Desktop • qimage font qt5.15.2 barcode • • Proton Phoenix  

      13
      0
      Votes
      13
      Posts
      300
      Views

      @artwaw said in Blurry and strange color when creating barcode using fonts: @Proton-Phoenix I no longer have access to the Zebra I was using in the past (I changed the company since then). Zebra printers are a story on their own to troubleshoot anyway... General approach I used: make sure the printer is configured properly in the system, with the default page size set to the target page size. query the QPrinterInfo instance for the default page size. use that data with QPdfWriter to render whatever text + barcode I need. remember DPI settings, either set what the manual for the printer says (ideal) or 300 (this didn't end well for Dymo printers I used for a while, needed exact DPI of 204 ;) ). print and enjoy. In general getting this to work might be lots of trial and error, depending on the brand and drivers. But once it's done right it is literally zero maintenance for years. <3 Thank you bro for everything <3
    • UNSOLVED Font size appears really small when switching from Qt 5.12 to Qt 5.15
      General and Desktop • font • • Andy1  

      4
      0
      Votes
      4
      Posts
      125
      Views

      something like this. Try it out QFont font("Courier New"); font.setStyleHint(QFont::Monospace); QApplication::setFont(font); or QCoreApplication::setFont(font);
    • UNSOLVED Fonts render to integer widths on some platforms, render to real number on others
      QML and Qt Quick • font width monospace • • Alpheratz  

      1
      0
      Votes
      1
      Posts
      73
      Views

      No one has replied

    • SOLVED Can't get QSettings to write my settings properly
      General and Desktop • c++ font qsettings font family config file • • radu.m10  

      14
      0
      Votes
      14
      Posts
      484
      Views

      I fixed this by setting QFont font = this->font(); to ui->appName->font(); in case anyone comes across this.
    • UNSOLVED Custom Font Doesn't looks like Same on Qt
      General and Desktop • font custom font figma • • Emrecp  

      8
      0
      Votes
      8
      Posts
      371
      Views

      @JKSH Now looks like very similar. Thanks everyone for help :)
    • UNSOLVED "fontSizeMode: Text.Fit" in Textfield
      QML and Qt Quick • qml font textfield • • PawlosCK  

      4
      0
      Votes
      4
      Posts
      841
      Views

      This is how we are sizing and centering text of variable size: Text { text: sometext width: somewidth height: someheight font.pointSize: 25 minimumPointSize: 2 fontSizeMode: Text.Fit horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter }
    • UNSOLVED larger emoji symbols
      General and Desktop • qml font emoji • • qwertzui11  

      1
      0
      Votes
      1
      Posts
      193
      Views

      No one has replied

    • UNSOLVED Linux .ini resource file and font specification
      General and Desktop • font debian settings qt5.12 • • Basile_Starynkevitch  

      4
      0
      Votes
      4
      Posts
      155
      Views

      When you don't want to let save it by Qt you have to read the font attributes one by one from your ini file and then construct it with the QFont ctor
    • UNSOLVED Scaling a text with multiple font sizes?
      General and Desktop • font fontsize qtexted • • legitnameyo  

      7
      0
      Votes
      7
      Posts
      930
      Views

      I've tried this but it only scales the first character for some reason, and after I stop scaling the font size returns to normal value = 0.3; // random value that increases the font size every time this part of the program is called for(int i = -1; i < textEdit->toPlainText().length() - 1; i++) { QTextCursor cursor = textEdit->textCursor(); cursor.setPosition(QTextCursor::Start + i, QTextCursor::MoveAnchor); // for some reason the first letter is start - 1 (start might be 1 and programming languages usually start counting at 0) cursor.setPosition(QTextCursor::Start + (i + 1), QTextCursor::KeepAnchor); // next position and keep anchor to highlight cursor.charFormat().font().setPointSize(cursor.charFormat().font().pointSize()*(value+1)); QTextCharFormat fmt; // resized but don't work fmt.setFontPointSize(cursor.charFormat().font().pointSize()*(value+1)); mergeFormatOnWordOrSelection(fmt); // resized and this works } void MainWindow::mergeFormatOnWordOrSelection(const QTextCharFormat &format) { QTextCursor cursor = textEdit->textCursor(); if (!cursor.hasSelection()) cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); cursor.mergeCharFormat(format); textEdit->mergeCurrentCharFormat(format); }
    • UNSOLVED Hindi and Gujarati font support for Qt5 on i.MX6 (Yocto Linux 4.1.15)
      Mobile and Embedded • qt5 font yocto i.mx6 linguist • • Ajith_P_V  

      6
      0
      Votes
      6
      Posts
      1511
      Views

      @Cleiton-Bueno Thank you very much for providing me more information on the Yocto language selection.
    • SOLVED QTabWidget TabBar font size weirdness
      General and Desktop • stylesheet qtabwidget font size qtabbar • • pauledd  

      3
      0
      Votes
      3
      Posts
      6663
      Views

      Thank you! I see you specified height and width manually. That works so far. I will use that.
    • UNSOLVED Incorrect Font Metrics
      General and Desktop • font text qt5.9 qt quick 2.4 metrics • • romsharkov  

      8
      0
      Votes
      8
      Posts
      3503
      Views

      @romsharkov said in Incorrect Font Metrics: @raven-worx Didn't know about those methods, just tested it, for the lower case letter "g": QFontMetricsF::leftBearing() returns: -4.17188 QFontMetricsF::rightBearing() returns: 0.6875 But even if I add the (negated) leftBearing to the total text width it still doesn't cover the tail entirely, so what's wrong here? are you sure?! Those values seem to be correct / make sense according to your posted screens. Make sure that you add the absolute value (qAbs() for example). Also keep in mind that those values are only correct for the given font-size and that you can't add negative values to a image width. I guess you are just doing incorrect calculations. Can you show the code of the calculation?
    • SOLVED Fonts always bold in Devanagari under Android
      Mobile and Embedded • android font bold devanagari noto • • _.-rFLo_.-  

      4
      0
      Votes
      4
      Posts
      1172
      Views

      Alright, problem solved. As so many times, the bug was sitting between chair and keyboard. In the FontLoader, I had the name property set. Which is set automatically if a font is loaded by source. https://doc.qt.io/qt-5/qml-qtquick-fontloader.html Having the name property set while loading a font by source is no problem under macOS but under Android, one Devanagari font started to dominate all instances, where Devanagari symbols appeared and all logic, how fonts are applied falls apart.
    • SOLVED QListView item font StyleSheet not working.
      General and Desktop • qlistview font item styesheet • • IL  

      5
      0
      Votes
      5
      Posts
      6531
      Views

      @raven-worx Thanks bro, very helpfull.
    • UNSOLVED QTableWidget font shrink on text wrap
      General and Desktop • qtablewidget font • • UnitScan  

      1
      0
      Votes
      1
      Posts
      519
      Views

      No one has replied

    • UNSOLVED Annoying font/FontLoader warning in QtQuick2.0 (Qt5.7)
      QML and Qt Quick • qml font text qt5.7 • • alizadeh91  

      2
      0
      Votes
      2
      Posts
      1140
      Views

      Please report a bug at bugreports.qt.io.
    • UNSOLVED resizable layout based on default font size
      QML and Qt Quick • qml qtquick resize font qtquick control • • randsfjorden  

      1
      0
      Votes
      1
      Posts
      772
      Views

      No one has replied

    • SOLVED Font changes not aplying
      General and Desktop • font raspberry pi 2 eglfs rpi2 • • cxam  

      16
      0
      Votes
      16
      Posts
      5058
      Views

      @mrjj Yes, What I did was QFontDatabase::addApplicationFont("/usr/share/fonts/truetype/Open_Sans/OpenSans-Regular.ttf"); and then select "Open Sans" on the QtDesigner
    • UNSOLVED Does QFont::setStyleName work at all?
      General and Desktop • font • • stephenju  

      5
      0
      Votes
      5
      Posts
      1460
      Views

      @mrjj I check and tried to replicate what the sample does but still doesn't work. I do notice the sample code uses the font in QTextDocument. Not sure if it matters. Also, from the documentation, weight and italic shouldn't matter once you set the style name http://doc.qt.io/qt-5/qfont.html#setStyleName However, I got it to work by using QFontDatabase::font() which takes the style name.
    • UNSOLVED Font Inheritance
      General and Desktop • font • • malch  

      1
      0
      Votes
      1
      Posts
      656
      Views

      No one has replied

    • SOLVED Qt Labs Controls font issues
      QML and Qt Quick • font controls 2 labs.controls • • morte  

      3
      0
      Votes
      3
      Posts
      959
      Views

      I've created a task https://bugreports.qt.io/browse/QTBUG-50984 so it doesn't get forgotten.
    • QWebView can't render unicode font on windows xp
      General and Desktop • qwebview font font family • • Giorgi  

      1
      0
      Votes
      1
      Posts
      846
      Views

      No one has replied

    • Qt crash in QRasterPaintEngine::alphaPenBlt() while painting label text
      Mobile and Embedded • font paint glyph • • URPradhan  

      10
      0
      Votes
      10
      Posts
      4243
      Views

      I found that this application also has the same issue (same error message when doing the same thing): https://local.ugene.unipro.ru/tracker/browse/UGENE-5411
    • set QFileDialog font
      Mobile and Embedded • font filedialog • • GregWilsonLindberg  

      2
      0
      Votes
      2
      Posts
      866
      Views

      Hi, AFAIK, you can't when calling the static methods, it's also a native file dialog so it should follow your OS settings
    • Using "Light" font weight from a font family doesn't work
      QML and Qt Quick • font family weight • • qwasder85  

      1
      0
      Votes
      1
      Posts
      854
      Views

      No one has replied

    • Css in middle of a text makes "\n" not work
      General and Desktop • qlabel font css settext • • roseicollis  

      1
      0
      Votes
      1
      Posts
      585
      Views

      No one has replied

    • Control PushButton doesn't display characters
      Mobile and Embedded • font display • • Halo_Hao  

      1
      0
      Votes
      1
      Posts
      503
      Views

      No one has replied

    • Font problem
      General and Desktop • qt 5.4 font • • Niclas Larsson  

      2
      0
      Votes
      2
      Posts
      1123
      Views

      Hi and welcome to devnet, Are you using a special font ?
    • QML Ubuntu 14.04 Font Rendering
      General and Desktop • qml ubuntu 14.04 font • • werispaul  

      1
      0
      Votes
      1
      Posts
      792
      Views

      No one has replied

    • [Solved] Fonts won't load on iOS but loads on Android
      Mobile and Embedded • android ios font • • eLim  

      7
      0
      Votes
      7
      Posts
      3266
      Views

      This is correct. This will be most likely a Windows-related problem with the ttf font.
    • [SOLVED] Latin text became corrupted while text in other writing system present
      Mobile and Embedded • font text font family text rendering font match text corruption • • alexein1983  

      2
      0
      Votes
      2
      Posts
      904
      Views

      I found a workaround: Define environment variable within Qt application startup context: QML_USE_GLYPHCACHE_WORKAROUND = 1 Look on this topic: https://forum.qt.io/topic/39803/font-rendering-bug-on-some-android-devices/7
    • QML Text items rendered as blocks - some iOS devices
      Mobile and Embedded • error text font • • bradsco  

      1
      0
      Votes
      1
      Posts
      543
      Views

      No one has replied

    • [SOLVED] (BEGINNER) How to print barcodes
      General and Desktop • c++ font beginner string newbie print conversion barcode starter code39 • • A7Victor  

      3
      0
      Votes
      3
      Posts
      2546
      Views

      @mcosta Hi, I'll certainly take a look at it. So I guess it's not only changing the font xD Thank you.
    • qml android texts are unclear
      Mobile and Embedded • text font textinput • • mehrdad  

      4
      0
      Votes
      4
      Posts
      1558
      Views

      thank you very much....
    • Qt Creator unreadable fonts
      The Lounge • qtcreator font text menu problem • • byT3b0N3  

      3
      0
      Votes
      3
      Posts
      1588
      Views

      ty, I have downgraded some packages (libglapi-mesa f.e.) and reinstalled some others. nopw everything is fine!
    • Qt Embedded, mixing unicode characters makes code lagging.
      Mobile and Embedded • font qt 4.8 unicode qtss • • MatsLindestam  

      2
      0
      Votes
      2
      Posts
      1232
      Views

      Hi and welcome to devnet, What version of Qt 4.8 are you currently using ?