View previous topic :: View next topic |
Author |
Message |
wosl
Joined: 31 Jan 2008 Posts: 30
|
Posted: Sun Feb 10, 2008 9:43 pm Post subject: Attributes of font using Choose_Font |
|
|
I'm looking for attributes of the font selected by the Choose_Font functions. How can I get the font name, size and the attributes (underline, bold, italic etc.)?
Any help appreciated ...
Wosl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Sun Feb 10, 2008 10:31 pm Post subject: |
|
|
choose_font@ is only used with %gr. It fires up the standard dialog box for selecting a font. The dialog gives a choice of font name, bold, italic etc.
If you want to create a font then you can use the Window API funtion CreateFont which you can use in your code and is documented at http://msdn2.microsoft.com/en-us/library/ms534214(VS.85).aspx |
|
Back to top |
|
|
wosl
Joined: 31 Jan 2008 Posts: 30
|
Posted: Mon Feb 11, 2008 4:40 pm Post subject: |
|
|
Thank you for your response!
I guess here is a misunderstanding. I don't want to create a new font (CreateFont). I just want to know the parameters of the font which the user has been selected.
Using the standard dialog box (chosse_font@ & %gr) I have currently two problems:
1. I can not set the default font name, size, bold/underline, italic switch before starting the dialog the first time or for subsequent calls.
2. When the user has selected a font, size, bold, underline etc. I don't see this selections for further postprocessing. In other words how can I detect which selection the user did for the text size, underline etc ...?
Wosl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Feb 11, 2008 5:21 pm Post subject: |
|
|
If you want users to select a font using the standard Microsoft font dialog then you will need to call the Windows API function called ChooseFont which is decribed at http://msdn2.microsoft.com/en-us/library/ms646914(VS.85).aspx
The easiest way to do this may be to write a function in C using the Silverfrost C compiler SCC. This function should call ChooseFont. The new function can then be called from your Fortran code. This will avoid the problem of trying to emulate the CHOOSEFONT structure in Fortran. |
|
Back to top |
|
|
|