Code: Select all
;https://www.purebasic.fr/english/memberlist.php?mode=viewprofile&u=17681
Procedure.s RegReadString(HKMain, HKSub$, HKEntry$)
hKey = 0
If RegOpenKeyEx_(HKMain, HKSub$, 0, #KEY_QUERY_VALUE, @hKey) = #ERROR_SUCCESS
result$ = Space(260)
bufLen = Len(result$)
If hKey
If RegQueryValueEx_(hKey, HKEntry$, 0, 0, @result$, @bufLen) <> #ERROR_SUCCESS
result$ = ""
EndIf
RegCloseKey_(hKey)
EndIf
Else
result$ = ""
EndIf
ProcedureReturn result$
EndProcedure
namer$ = "Bahnschrift" + " (TrueType)"
Debug RegReadString(#HKEY_LOCAL_MACHINE,"Software\Microsoft\Windows NT\CurrentVersion\fonts",namer$)
When you select a font using FontRequester() it gives you a font family name like "Bahnschrift Light Condensed". I couldn't find anything on the registry with "Light Condensed". I also tried using GDI retrieving font family using tagLOGFONTW structure, and also GetTextFace_ but they both return the name with qualifiers and I am not able to find a match for the actual font. Any one has any workaround for this or any other ideas and how to get the font file name?
Thank you.
Norm.