📄 wpw_wapi_font_95.html
字号:
<HTML>
<HR><A NAME=WINAPI_Font_Large_Setting>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Determine Large Font Setting</H4><PRE>
Is there a way for allowing a program to determine if it is running
on windows with the normal or large font setting, as this determines
the size of the title bar of the window?
Thanks in anticipation,
Andrew (Melbourne, Australia)
<HR>
In article <3s2umj$123@harbinger.cc.monash.edu.au> <andrew@cobra.path.monash.edu.au> writes:
>Is there a way for allowing a program to determine if it is running
>on windows with the normal or large font setting
Yes, this is easy. GetDeviceCaps(LOGPIXELSX) and GetDeviceCaps(LOGPIXELSY)
give you this information. They will usually--but not always--return the same
number. 96 is Small Fonts, 120 is Large Fonts. However, there can be other
resolutions selected here as well, and the two values will be different if you
don't have square pixels.
>. . . as this determines the size of the title bar of the window?
No, it doesn't. There is no direct connection between the two. To get the
height of the title bar, use GetSystemMetrics(SM_CYCAPTION).
-Mike
<HR>
In article <3s2umj$123@harbinger.cc.monash.edu.au>
andrew@cobra.path.monash.edu.au
"<andrew@cobra.path.monash.edu.au>
" writes:
>Is there a way for allowing a program to determine if it is running
>on windows with the normal or large font setting, as this determines
>the size of the title bar of the window?
Take a look at the "GetSystemMetrics" API.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_Font_Rotate_Text>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Rotating Text</H4><PRE>
In article <DB1EuA.JKC@inter.NL.net> maarte@gandalf.pallas.nl (Maarte van Hattem) writes:
>Hi,
>
>I'm looking for routines which allows me to rotate text on the screen.
>This meams not putting letters beneath each other but rotate it +/-90
>degrees. In PostScript and (News) this is (was) an easy job. But how
>to do this within Windows?
Create an HFONT (i.e. CreateFont...) with LOGFONT.lfEscapement
set to the required angle. Read the docs carefully!!! - the
sense of rotation depends on the current mapping mode (GetMapMode).
Also read about LOGFONT.lfClipPrecision, with respect to rotated
text.
--
John A. Grant jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
<HR>
In article <DB1EuA.JKC@inter.NL.net>
maarte@gandalf.pallas.nl "Maarte van Hattem" writes:
>Hi,
>
>I'm looking for routines which allows me to rotate text on the screen.
>This meams not putting letters beneath each other but rotate it +/-90
>degrees. In PostScript and (News) this is (was) an easy job. But how
>to do this within Windows?
It's very easy in Windows too. When you create the font, set the
"lfEscapement" parameter to the required angle of the font, measured
anticlockwise from the positive X-axis in units of 10ths of a degree.
You can do this with any "scaleable" (TrueType, vector, or ATM) font.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_Font_DISPLAY_MUL_QUICK>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: How to display multiple font quickly?</H4><PRE>
In article <3u0im5$ot2@fnord.dccs.com.au> dave@dccs.com.au "Dave Cole" writes:
>I have an application where I want to display approximately 10 fonts
>simultaneously in a scrolled window. What is the best way to optimise
>the font usage in my program to get the fastest display updates?
>
>- Should I create all of the fonts and cache them?
This sounds like a reasonable idea. 10 fonts won't use a vast amount
of GDI heap space.
>- Should I create a DC for each of the fonts and draw into the DC
> associated with the font? I know there is a limit on the number of
> DC in Win3.11, but I can't remember where I saw the limit mentioned.
This is NOT a good idea. Just have a single DC and call "SelectObject"
for whatever font you want to draw with. SelectObject is a very quick
call.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_Font_SAVE_RESTORE>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: How to Save and Restore Font Setting?</H4><PRE>
In an application I let the user choose which font should be used when printing
text on a printer.
I would like to save this information in the app INI file, but I am not sure
which representation would be the best. Also it would be nice to follow any
"standards" in this area.
So far I'm thinking of saving the following parameters for the font (at least
the first two):
FaceName "Arial"
Height 12
Weight 500,700 or Normal,Bold or Yes,No
Italic Yes,No
with hardcoded values for things like CharSet, Quality and others.
Any suggestions how this is best stored in a text string in an .INI file?
Is there any "standard way" of saving a font choosen by the user?
/Stefan
<HR>
adam@netline.net wrote:
>Im new to OWL programming so please forgive my stupidity, Im trying to
>just make my main window Fullscreen, Im getting nothing though, any
>help is appreciated...
<B>
1) Open the cross reference database OWL source code and OWL sample cdoe
with my ixfwin program.
*** You might have to download my program and build the database first.
*** check my .sig for URL link to the ixfwin program.
2) Search for SW_SHOWMAXIMIZED identifier.
3) Browse the source code and find out how Borland does it.
4) Copy and paste their source code to your program.
5) Tested it a bit and you should finish this feature in half hour or less.
-Tony Lee
Author of "Interactive Cross Reference for Win16/WinNT": A program that
lets you find any functions, macros, variables, etc in hundreds of files
instantly and interactively. http://www.kudonet.com/~ixfwin/ixfw/ixfw.html
I also keep a lot useful Q&A from comp.os.ms-windows.programming.* in
http://www.kudonet.com/~ixfwin/winprog_faqs/winprog_faqs.html
</B>
<HR>
In my apps I write out all the LOGFONT parameters to a string with
"sprintf" and store that in the INI file, reading it back in the same
way. The only change I make is that I replace the height parameters
(which is in logical units of course) by the desired height in points,
so it's device independent.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
<HR>
Well I would store it as a comma delimited strings as...
FaceName, Height, Weight, Italic(Y/N), Underline(Y/N), Bold(Y/N),
PitchandFamily, RedWeight, GreenWeight, BlueWeight
Just read 'em in and parse them using strtok to fill up the logfont
structure. Personally I don't think there are any established
standard for this sort of thing.
Rajen Narurkar
<HR>
I use only the "faceName", point-size, and a style parameter. Usually, one uses
the PROOF_QUALITY and ANSI_CHARSET settings, which will not change. Another point
of view is to "hide" setting like Bold/Normal, Italic and Underlined in one value
to save space in the *.ini file. But remember that the height of the font is
to be specified in negative values to get true point sizes. Otherwise, one gets
defines the bounding box height, e.g. point size 12 leads to positive value 16 for
the box.
Chris
------------------------
Christoph Pelich
C.Pelich@tu-bs.de
<HR>
In article <DC6s9t.L3K@emr1.emr.ca> jagrant@emr1.emr.ca "John Grant" writes:
> This has already been answered, but just to prevent misinformation
> from propagating...
>
> \r won't work and \n won't work. Edit controls use CF_TEXT
> format which requires \r\n delimiters.
To add to what John said, the reason for this is to allow you to read a
DOS text file directly into an EDIT control. "\r\n" or <CR><LF> is the
DOS "end of line" sequence.
Chris
--
--------------------------------------------------------------------------
Chris Marriott, Warrington, UK | Author of SkyMap v2 award-winning
chris@chrism.demon.co.uk | shareware Windows planetarium.
For full info, see http://www.execpc.com/~skymap
Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------
<HR>
>: I would like to save this information in the app INI file, but I am not sure
>: which representation would be the best. Also it would be nice to follow any
>: "standards" in this area.
>: Any suggestions how this is best stored in a text string in an .INI file?
>: Is there any "standard way" of saving a font choosen by the user?
>I use only the "faceName", point-size, and a style parameter. Usually, one uses
>the PROOF_QUALITY and ANSI_CHARSET settings, which will not change. Another >point
>of view is to "hide" setting like Bold/Normal, Italic and Underlined in one >value
You mean that it would be something like:
Font=Courier New, 12, Bold, Upright
or
Font=Courier New, 12, 526
Well this was my thought as well, but isn't there any "normal" (or "Standard")
way of doing this? Does everybody invent their own coding?
</PRE>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -