You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
local font as logfont
getobject getstockobject( %ansi_var_font ), sizeof( font ), font
this way you will have the name loaded in font.lffacename, and also the height and the average width of the font (respectively in font.lfheight and font.lfwidth). this can be useful when converting pixels to dialog units and vice-versa.
Is ANSI_VAR_FONT always MS Sans Serif, or more important - is
MS Sans Serif always called MS Sans Serif? Guess not. I used an
exact string to create some fonts for new version of Poffs and a
few has reported weird fonts on some buttons. Wrote the following
routine to make sure in the future, maybe someone can benefit from it:
Code:
LOCAL hDC AS LONG, tFont AS LONG, zs AS ASCIIZ * %LF_FACESIZE
hDC = GetDC (hDlg) 'Get correct %ANSI_VAR_FONT name
tFont = SelectObject(hDC, GetStockObject(%ANSI_VAR_FONT))
CALL GetTextFace(hDC, SIZEOF(zs), zs)
SelectObject hDC, tFont
CALL ReleaseDC (hDlg, hDC)
'zs should now hold the name we are looking for..
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: