how to use font without installing

56 views
Skip to first unread message

kofa kofa

unread,
Jan 5, 2026, 7:24:43 AM (6 days ago) Jan 5
to The Ring Programming Language
hello everyone

how to use font without installing
This means the font is only located in the project folder.

Mahmoud Fayed

unread,
Jan 5, 2026, 9:49:42 AM (6 days ago) Jan 5
to The Ring Programming Language
Hello Kofa

>> "how to use font without installing"

Try
oFont = new qfont("MyFontFile.ttf",0,0,0)
oFont.setPixelSize(20)

Then inside your widget use
setfont(oFont)

Greetings,
Mahmoud


Mahmoud Fayed

unread,
Jan 5, 2026, 10:04:03 AM (6 days ago) Jan 5
to The Ring Programming Language
Hello Kofa

RingQt miss the QFontDatbase class, which could be necessary to do this 

I have a plan to add a group of Qt classes to RingQt, once this is done, I will let you know.

Greetings,
Mahmoud

On Monday, January 5, 2026 at 3:24:43 PM UTC+3 kofa kofa wrote:

Mahmoud Fayed

unread,
Jan 5, 2026, 11:18:42 AM (6 days ago) Jan 5
to The Ring Programming Language
Hello Kofa

The QFontDatabase class is added to RingQt in this commit:  Update RingQt - Add: QFontDatabase class · ring-lang/ring@75517ce


To get this update run the next command

ringpm update ringqt

Screen Shot:
mylocalfont.png

Source Code:

load "guilib.ring"

oFontDB = new QFontDatabase()
loadedFontID = oFontDB.addApplicationfont("pirulen.ttf")
aFam= oFontDB.applicationfontfamilies(loadedFontID)
cFont = aFam.at(0)
oFont = new QFont(cFont,0,0,0)
oFont.setPointSize(20)

app = new QApp {
win = new QWidget() {
setWindowTitle("Load local font file")
resize(800,600)
lbl = new QLabel(win) {
move(100,100)
setfont(oFont)
setText("I LOVE PROGRAMMING")
}
show()
}
exec()
}

Greetings,
Mahmoud

On Monday, January 5, 2026 at 3:24:43 PM UTC+3 kofa kofa wrote:

Mansour Ayouni

unread,
Jan 5, 2026, 11:26:16 AM (6 days ago) Jan 5
to Mahmoud Fayed, The Ring Programming Language
Hello Mahmoud,

Thank you for this addition to RingQt!

All the best.
Mansour

--

---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/b9792aeb-d13c-4598-98f9-eff2c9a608d0n%40googlegroups.com.

Mahmoud Fayed

unread,
Jan 5, 2026, 11:34:37 AM (6 days ago) Jan 5
to The Ring Programming Language
Hello Mansour

>> "Thank you for this addition to RingQt!"

You are welcome :D

Greetings,
Mahmoud

kofa kofa

unread,
Jan 6, 2026, 1:15:46 AM (6 days ago) Jan 6
to The Ring Programming Language
thank you very much

Mahmoud Fayed

unread,
Jan 6, 2026, 1:19:10 AM (6 days ago) Jan 6
to The Ring Programming Language
Hello Kofa

You are welcome :D

Greetings,
Mahmoud

Reply all
Reply to author
Forward
0 new messages