Quick question, I need to know how to get the wParam of WM_SETFONT (the font handle) of a TrueType font file (*.ttf) that is not installed. I'm using it for a PostMessage. It may be very obvious, but I don't have the time right now to figure it out.
Any help is appreciated.
Get font handle from file (HFONT) [solved]
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Get font handle from file (HFONT) [solved]
Last edited by Masonjar13 on 06 Jan 2015, 13:48, edited 1 time in total.
Re: Get font handle from file (HFONT)
Here is the MSDN link for CreateFont function. Return value gives hFont
http://msdn.microsoft.com/en-us/library ... s.85).aspx
usage
sFaceName is the name of font, variables with b as prefix are booleans. Refer to MSDN link provided
http://msdn.microsoft.com/en-us/library ... s.85).aspx
usage
Code: Select all
hFont := DllCall("CreateFont", "int", nHeight, "int", 0, "int", 0, "int", 0, "int", 400 + 300 * bBold, "Uint", bItalic, "Uint", bUnderline, "Uint", bStrikeOut, "Uint", nCharSet, "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0, "str", sFaceName)
Try out CMD class
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Get font handle from file (HFONT)
Thanks for the reply.
The function you suggest isn't exact to what I said; I need to get hFont from a non-installed *.ttf file, based on it's file address. As far as I can tell, this function requires entries that should be handled completely by the file and also requires a typeface name, which implies an installed font.
The function you suggest isn't exact to what I said; I need to get hFont from a non-installed *.ttf file, based on it's file address. As far as I can tell, this function requires entries that should be handled completely by the file and also requires a typeface name, which implies an installed font.
Re: Get font handle from file (HFONT)
Class_CustomFont - Load font from font file
http://ahkscript.org/boards/viewtopic.php?f=6&t=813
http://ahkscript.org/boards/viewtopic.php?f=6&t=813
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Get font handle from file (HFONT)
Exactly what I was looking for, thank you.tmplinshi wrote:Class_CustomFont - Load font from font file
http://ahkscript.org/boards/viewtopic.php?f=6&t=813