Can gdi+ load custom fonts from .ttf files?
Posted: 05 Feb 2018, 22:35
Edited subject name from Can gdi+ render on desktop behind icons and can i somehow load custom fonts from .ttf files? for separation purposes.
Pretty much the topics subject. I could not find a function for tics GDI lib to use custom fonts from files, which is a shame.
I would like to render some text or image on desktop but behind icons. If possible of course.
GDI seems much more powerful than standard GUI so perhaps its possible with it? Or any other way to achieve this?
While im on the GDI subject, how come GDI lib is not added to AHK natively?
Also, could for instance multiple functions from GDI lib needed to show text be replaced with something like:
and AHK to interpret / replace them as:
Could this be somehow added to AHK? That would be amazing.
Otherwise i will just need to find a way to condense this, because there is just a lot of lines of functions for something that is rather mandatory.
At least for a simple text or image to show.
Pretty much the topics subject. I could not find a function for tics GDI lib to use custom fonts from files, which is a shame.
I would like to render some text or image on desktop but behind icons. If possible of course.
GDI seems much more powerful than standard GUI so perhaps its possible with it? Or any other way to achieve this?
While im on the GDI subject, how come GDI lib is not added to AHK natively?
Also, could for instance multiple functions from GDI lib needed to show text be replaced with something like:
Code: Select all
GDI, ADD, Text, Options, Some Text
GDI, Show, Options
Code: Select all
; replace with GDI, ADD and Options (W H)
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
; replace with Some Text and Options (W, H, Font, FontSize, FontColor etc...)
Gdip_TextToGraphics(G, Some Text, Options, Font, Width, Height)
; replace with GDI, Show and Options (Gui Number on which to show to if specified (default 1), X, Y, W, H)
UpdateLayeredWindow(hwnd, hdc, PosX, PosY, Width, Height)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Otherwise i will just need to find a way to condense this, because there is just a lot of lines of functions for something that is rather mandatory.
At least for a simple text or image to show.