亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch07.htm

?? 21天學(xué)會(huì)VC的英文版
?? HTM
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '</head>';
 zhtm += '<BODY bgcolor="#FFFFFF">
<!-- Spidersoft WebZIP Ad Banner Insert -->
<TABLE width=100% border="0" cellpadding="0" cellspacing="0">
<TR>
<TD>
<ILAYER id=ad1 visibility=hidden height=60></ILAYER>
<NOLAYER>
<IFRAME SRC="http://www.spidersoft.com/ads/bwz468_60.htm" width="100%" height="60" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></IFRAME>
</NOLAYER>
</TD>
</TR>
</TABLE>
<!-- End of Spidersoft WebZIP Ad Banner Insert-->
';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '
<layer src="http://www.spidersoft.com/ads/bwz468_60.htm" visibility=hidden id=a1 width=600 onload="moveToAbsolute(ad1.pageX,ad1.pageY); a1.clip.height=60;visibility='show';"></layer>
</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="../../../../includes/stylesheets/ebooks.css">

	<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1.1">
	<TITLE>Teach Yourself Visual C++ 6 in 21 Days -- Ch 7 -- Working with Text and Fonts</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<H1 ALIGN="CENTER"><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM"
BORDER="0"><BR>
Teach Yourself Visual C++ 6 in 21 Days</H1>
<CENTER>
<P><A HREF="../ch06/ch06.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch08/ch08.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<H1 ALIGN="CENTER">- 7 -<BR>
Working with Text and Fonts</H1>
<H1></H1>

<UL>
	<LI><A HREF="#Heading1">Finding and Using Fonts</A>
	<UL>
		<LI><A HREF="#Heading2">Listing the Available Fonts</A>
		<LI><A HREF="#Heading3">Using a Font</A>
	</UL>
	<LI><A HREF="#Heading4">Using Fonts</A>
	<UL>
		<LI><A HREF="#Heading5">Creating the Application Shell</A>
		<LI><A HREF="#Heading6">Building a List of Fonts</A>
		<LI><A HREF="#Heading7">Setting the Font Sample Text</A>
		<LI><A HREF="#Heading8">Selecting a Font to Display</A>
	</UL>
	<LI><A HREF="#Heading9">Summary</A>
	<LI><A HREF="#Heading10">Q&amp;A</A>
	<LI><A HREF="#Heading11">Workshop</A>
	<LI><A HREF="#Heading12">Quiz</A>
	<UL>
		<LI><A HREF="#Heading13">Exercises</A>
	</UL>
	<LI><A HREF="#Heading14">In Review</A>
</UL>

<P>
<HR SIZE="4">
<BR>
In most Windows applications, you don't need to worry about specifying fonts, much
less their weight, height, and so on. If you don't specify the font to be used, Windows
supplies a default font for your application. If you do need to use a particular
font, you can specify a font to use for a particular dialog window through the dialog
properties. Sometimes, however, you want or need to control the font used in your
application. You might need to change the font being used or allow the user to select
a font to use in a particular instance. It is for those circumstances that you will
learn how to change and list fonts today. Among the things that you will learn are</P>

<P>

<UL>
	<LI>How to build a list of available fonts.
	<P>
	<LI>How to specify a font for use.
	<P>
	<LI>How to change fonts dynamically.
</UL>

<H2><A NAME="Heading1"></A>Finding and Using Fonts</H2>
<P>One of the first things that you need to know when working with fonts is that
not every system that your applications run on will have the same fonts installed.
Fonts are specified in files that can be installed and removed from Windows systems
with relative ease. Every computer user can customize his system with whatever combination
of fonts he wants. If you specify a font that doesn't exist on the system, Windows
will choose either the system default font or what the operating system considers
to be a reasonably close alternative font.</P>
<P>What you can do instead is ask the operating system what fonts are available.
This method allows you to make your own decisions on which font to use or let the
user make the decision. When you ask what fonts are available, you can limit the
types of fonts that are listed, or you can choose to list them all and select various
fonts based on various attributes.</P>
<P>
<H3><A NAME="Heading2"></A>Listing the Available Fonts</H3>
<P>To get a list of all available fonts on a computer, you call a Windows API (Application
Programming Interface) function called EnumFontFamiliesEx. This function tells Windows
that you want a list of the fonts on the system. Before you start using this function
and expecting it to pass you a big list of available fonts, you need to understand
how it gives you the list.</P>
<P>
<H4>Callback Functions</H4>
<P>One of the key arguments to the EnumFontFamiliesEx function is the address of
another function. This second function is what is known as a callback function, which
is called by the operating system. For almost every enumeration function in the Windows
operating system, you pass the address of a callback function as an argument because
the callback function is called once for each of the elements in the enumerated list.
In other words, you have to include a function in your application to receive each
individual font that is on the system and then build the list of fonts yourself.</P>
<P>When you create this function to receive each font and build your list, you cannot
define your callback function in any way you want. All callback functions are already
defined in the Windows API. You have to use a specific type of callback function
to receive the list of fonts. For getting a list of fonts, the function type is EnumFontFamProc.
This function type specifies how your function must be defined, what its arguments
must be, and what type of return value it must return. It does not specify what your
function should be named or how it needs to work internally. These aspects are left
completely up to you.</P>
<P>
<H4>The EnumFontFamiliesEx Function</H4>
<P>The EnumFontFamiliesEx function, which you call to request the list of available
fonts, takes five arguments. A typical use of this function follows:</P>
<P>
<PRE>// Create a device context variable
CClientDC dc (this);
// Declare a LOGFONT structure
LOGFONT lLogFont;
// Specify the character set
lLogFont.lfCharSet = DEFAULT_CHARSET;
// Specify all fonts
lLogFont.lfFaceName[0] = NULL;
// Must be zero unless Hebrew or Arabic
lLogFont.lfPitchAndFamily = 0;
// Enumerate the font families
::EnumFontFamiliesEx((HDC) dc, &amp;lLogFont,
(FONTENUMPROC) EnumFontFamProc, (LPARAM) this, 0);
</PRE>
<P>The first argument is a device context, which can be an instance of the CClientDC
class. Every application running within the Windows operating system has a device
context. The device context provides a lot of necessary information to the operating
system about what is available to the application and what is not.</P>
<P>The second argument is a pointer to a LOGFONT structure. This structure contains
information about the fonts that you want listed. You can specify in this structure
which character set you want to list or whether you want all the fonts in a particular
font family. If you want all the fonts on the system, you pass NULL in the place
of this argument.</P>
<P>The third argument is the address of the callback function that will be used to
build your list of fonts. Passing the address of your callback function is a simple
matter of using the function name as the argument. The Visual C++ compiler takes
care of replacing the function name with the function address. However, you do need
to cast the function as the type of callback function that the function requires.</P>
<P>The fourth argument is a LPARAM value that will be passed to the callback function.
This parameter is not used by Windows but provides your callback function with a
context in which to build the font list. In the example, the value being passed is
a pointer to the window in which the code is being run. This way, the callback function
can use this pointer to access any structures it needs to build the list of fonts.
This pointer can also be the first node in a linked list of fonts or other such structure.</P>
<P>The fifth and final argument is always 0. This reserved argument may be used in
future versions of Windows, but for now, it must be 0 so that your application passes
a value that won't cause the function to misbehave.</P>
<P>
<H4>The EnumFontFamProc Function Type</H4>
<P>When you create your callback function, it must be defined as an independent function,
not as a member of any C++ class. A typical EnumFontFamProc function declaration
follows:</P>
<P>
<PRE>int CALLBACK EnumFontFamProc(
LPENUMLOGFONT lpelf,
LPNEWTEXTMETRIC lpntm,
DWORD nFontType,
long lParam)
{
    // Create a pointer to the dialog window
    CMyDlg* pWnd = (CMyDlg*) lParam;
    // Add the font name to the list box
    pWnd-&gt;m_ctlFontList.AddString(lpelf-&gt;elfLogFont.lfFaceName);
    // Return 1 to continue font enumeration
    return 1;
}
</PRE>
<P>The first argument to this function is a pointer to an ENUMLOGFONTEX structure.
This structure contains information about the logical attributes of the font, including
the font name, style, and script. You may have numerous fonts listed with the same
name but different styles. You can have one for normal, one for bold, one for italic,
and one for bold italic.</P>
<P>The second argument is a pointer to a NEWTEXTMETRICEX structure. This structure
contains information about the physical attributes of the font, such as height, width,
and space around the font. These values are all relative in nature because they need
to scale as the font is made larger or smaller.</P>
<P>The third argument is a flag that specifies the type of font. This value may contain
a combination of the following values:</P>

<UL>
	<LI>DEVICE_FONTYPE
	<LI>RASTER_FONTYPE
	<P>
	<LI>TRUETYPE_FONTYPE
</UL>

<P>Finally, the fourth argument is the value that was passed into the EnumFontFamiliesEx
function. In the example, it was a pointer to the dialog on which the list of fonts
is being built. If you cast this value as a pointer to the dialog, the function can
access a list box control to add the font names.</P>
<P>The return value from this function determines whether the listing of fonts continues.
If 0 is returned from this function, the operating system quits listing the available
fonts. If 1 is returned, the operating system continues to list the available fonts.</P>
<P>
<H3><A NAME="Heading3"></A>Using a Font</H3>
<P>To use a particular font in an application, you call an instance of the CFont
class. By calling the CreateFont method, you can specify the font to be used, along
with the size, style, and orientation. Once you've created a font, you can tell a
control or window to use the font by calling the object's SetFont method. An example
of this process follows:</P>
<P>
<PRE>CFont m_fFont;    // The font to be used
// Create the font to be used
m_fFont.CreateFont(12, 0, 0, 0, FW_NORMAL,
        0, 0, 0, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS,
        CLIP_CHARACTER_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH |
        FF_DONTCARE, m_sFontName);
// Set the font for the display area
m_ctlDisplayText.SetFont(&amp;m_fFont);
</PRE>


<BLOCKQUOTE>
	<P>
<HR>
<STRONG>TIP:</STRONG> The CFont variable used in the previous code should be declared as
	a member variable of the class in which this code is placed. In the sample code,
	it is declared above where it is used to show how it is declared. This variable should
	not be declared or used as a local variable in a function.
<HR>


</BLOCKQUOTE>

<P>Seems simple enough--just two function calls--but that CreateFont function needs
an awful lot of arguments passed to it. It is these arguments that make the CreateFont
method a flexible function with a large amount of functionality. Once you create
the font, using it is a simple matter of passing the font to the SetFont method,
which is a member of the CWnd class and thus available to all window and control
classes in Visual C++. This means that you can use this technique on any visible
object within a Visual C++ application.</P>
<P>To understand how the CreateFont function works, let's look at the individual
arguments that you have to pass to it. The function is defined as</P>
<P>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合久久综合亚洲| 欧美一级日韩不卡播放免费| 777色狠狠一区二区三区| 国产精品成人午夜| 国产精品综合视频| 欧美一级片免费看| 成人黄色av电影| 国产三级三级三级精品8ⅰ区| 亚洲午夜久久久久久久久电影网| 成人精品电影在线观看| 日韩国产精品久久久| 欧美一区二区三区系列电影| av亚洲精华国产精华精| 亚洲欧洲韩国日本视频| 91网站视频在线观看| 亚洲一区二区三区中文字幕在线| 在线精品国精品国产尤物884a| 综合激情网...| 欧美日本一道本在线视频| 亚洲v精品v日韩v欧美v专区 | 色婷婷亚洲精品| 一区精品在线播放| 久久久.com| 欧美一二三区精品| 国产成人免费av在线| 最近中文字幕一区二区三区| 久久久99精品久久| 久久影视一区二区| 日韩精品一区在线观看| 成人激情免费视频| 国产成人一区二区精品非洲| 经典三级在线一区| 国产精品国产自产拍高清av | 午夜视频在线观看一区| 精品久久久久久综合日本欧美| 丁香六月综合激情| 午夜精品成人在线| 亚洲国产一区在线观看| 亚洲国产美女搞黄色| 亚洲一区二区综合| 亚洲无线码一区二区三区| 亚洲一区二区三区四区在线| 亚洲动漫第一页| 亚洲成a人片综合在线| 亚洲成人自拍网| 日韩成人一级大片| 美女www一区二区| 亚洲综合精品自拍| 亚洲国产日韩在线一区模特| 午夜视频在线观看一区| 免费欧美在线视频| 亚洲国产裸拍裸体视频在线观看乱了| 夜夜爽夜夜爽精品视频| 久久久综合激的五月天| 91精品一区二区三区久久久久久 | 国产大陆a不卡| 成人在线综合网站| 色综合亚洲欧洲| 国产露脸91国语对白| 国产不卡视频一区| 久久99精品一区二区三区三区| 精品一区二区三区av| 不卡一区二区中文字幕| 日本黄色一区二区| 成人av免费在线播放| 日本高清不卡一区| 91精品久久久久久久91蜜桃| 久久看人人爽人人| 一区二区三区色| 青青草国产精品97视觉盛宴 | 国产一区不卡视频| 蜜臀精品一区二区三区在线观看 | 日韩不卡免费视频| 国产精品综合网| 91国产免费观看| 精品国产乱码久久久久久浪潮| 欧美在线色视频| 精品欧美黑人一区二区三区| 国产精品国产三级国产aⅴ入口| 一区二区不卡在线播放 | 欧美三片在线视频观看| 一本色道久久综合亚洲91| 欧美一区二区三区小说| 国产精品理伦片| 免费不卡在线视频| 不卡的电影网站| 日韩欧美一级精品久久| 亚洲色图丝袜美腿| 国产一区二区三区在线看麻豆| 99视频热这里只有精品免费| 欧美一级一区二区| 亚洲你懂的在线视频| 依依成人精品视频| 亚洲高清在线精品| 成人性生交大合| 日韩丝袜情趣美女图片| 综合电影一区二区三区 | 欧美一区二区三区在线看| 国产精品女同互慰在线看| 国产精品国产三级国产专播品爱网 | 欧美喷潮久久久xxxxx| 亚洲国产经典视频| 亚洲天堂av一区| 国产精一区二区三区| 欧美精品一卡两卡| 精品乱人伦小说| 亚洲h精品动漫在线观看| eeuss鲁片一区二区三区在线看| 精品处破学生在线二十三| 亚洲一区在线播放| 97精品国产露脸对白| 欧美三级视频在线播放| 国产精品久久久久久久浪潮网站| 久久精品国产在热久久| 粉嫩aⅴ一区二区三区四区| 91精品国产美女浴室洗澡无遮挡| 亚洲精品视频一区| 成人免费的视频| 国产无遮挡一区二区三区毛片日本| 免费观看日韩电影| 欧美体内she精高潮| 精品日韩av一区二区| 天堂影院一区二区| 国产精品99久久久久久有的能看| 欧美一区二区视频免费观看| 亚洲成人免费在线观看| 在线看日韩精品电影| 亚洲色欲色欲www| 91原创在线视频| 国产精品久久久久婷婷二区次| 国产99久久久久| 国产女人18毛片水真多成人如厕| 久久电影国产免费久久电影| 欧美一区二区三区小说| 日韩av在线免费观看不卡| 欧美日韩国产电影| 五月婷婷综合激情| 欧美日韩在线一区二区| 亚洲一区二区在线观看视频| 欧美午夜精品久久久久久超碰| 亚洲欧美日韩在线| 日本高清不卡视频| 亚洲不卡av一区二区三区| 欧美精品自拍偷拍| 日韩精品亚洲一区| 日韩欧美一级二级| 国产精品一区二区三区网站| 国产免费成人在线视频| 99re在线精品| 亚洲国产视频直播| 8v天堂国产在线一区二区| 麻豆91免费观看| 久久免费电影网| 91同城在线观看| 亚洲大片一区二区三区| 91精品国产美女浴室洗澡无遮挡| 免费观看在线综合| 国产女人aaa级久久久级| 99九九99九九九视频精品| 亚洲最大的成人av| 欧美第一区第二区| 成人激情午夜影院| 亚洲一区二区成人在线观看| 日韩欧美一卡二卡| 丁香桃色午夜亚洲一区二区三区| √…a在线天堂一区| 在线不卡的av| 国产激情视频一区二区三区欧美| 18成人在线视频| 91精品国产免费久久综合| 国产不卡高清在线观看视频| 亚洲美女少妇撒尿| 日韩欧美视频在线| 91热门视频在线观看| 日本aⅴ免费视频一区二区三区 | 91在线你懂得| 天天爽夜夜爽夜夜爽精品视频| 久久久久久99精品| 欧美日韩精品一区二区天天拍小说 | 91麻豆高清视频| 免费欧美在线视频| 日韩理论片一区二区| 日韩丝袜情趣美女图片| 成人黄色在线视频| 日韩电影免费在线| 国产精品久久久久久亚洲毛片 | 亚洲一区二区精品3399| 久久精品人人做人人爽人人| 欧美视频一区二区三区| 丁香激情综合五月| 麻豆91精品91久久久的内涵| 成人免费一区二区三区在线观看| 欧美丰满一区二区免费视频| 懂色av噜噜一区二区三区av| 免费在线观看一区二区三区| 亚洲另类一区二区| 国产喷白浆一区二区三区| 制服丝袜日韩国产| 一本色道久久综合亚洲91| 国产精品中文字幕日韩精品|