font.tex

来自「Wxpython Implemented on Windows CE, Sou」· TEX 代码 · 共 602 行 · 第 1/2 页

TEX
602
字号

\membersection{wxFont::GetNativeFontInfoDesc}\label{wxfontgetnativefontinfodesc}

\constfunc{wxString}{GetNativeFontInfoDesc}{\void}

Returns the platform-dependent string completely describing this font.
Returned string is always non-empty.
Note that the returned string is not meant to be shown or edited by the user: a typical
use of this function is for serializing in string-form a wxFont object.

\wxheading{See also}

\helpref{wxFont::SetNativeFontInfo}{wxfontsetnativefontinfo},\helpref{wxFont::GetNativeFontInfoUserDesc}{wxfontgetnativefontinfouserdesc}


\membersection{wxFont::GetNativeFontInfoUserDesc}\label{wxfontgetnativefontinfouserdesc}

\func{wxString}{GetNativeFontInfoUserDesc}{\void}

Returns a user-friendly string for this font object. Returned string is always non-empty.
Some examples of the formats of returned strings (which are platform-dependent) are in \helpref{SetNativeFontInfoUserDesc}{wxfontsetnativefontinfouserdesc}.

\wxheading{See also}

\helpref{wxFont::GetNativeFontInfoDesc}{wxfontgetnativefontinfodesc}


\membersection{wxFont::GetPointSize}\label{wxfontgetpointsize}

\constfunc{int}{GetPointSize}{\void}

Gets the point size.

\wxheading{See also}

\helpref{wxFont::SetPointSize}{wxfontsetpointsize}


\membersection{wxFont::GetStyle}\label{wxfontgetstyle}

\constfunc{int}{GetStyle}{\void}

Gets the font style. See \helpref{wxFont::wxFont}{wxfontctor} for a list of valid
styles.

\wxheading{See also}

\helpref{wxFont::SetStyle}{wxfontsetstyle}


\membersection{wxFont::GetUnderlined}\label{wxfontgetunderlined}

\constfunc{bool}{GetUnderlined}{\void}

Returns true if the font is underlined, false otherwise.

\wxheading{See also}

\helpref{wxFont::SetUnderlined}{wxfontsetunderlined}


\membersection{wxFont::GetWeight}\label{wxfontgetweight}

\constfunc{wxFontWeight}{GetWeight}{\void}

Gets the font weight. See \helpref{wxFont::wxFont}{wxfontctor} for a list of valid
weight identifiers.

\wxheading{See also}

\helpref{wxFont::SetWeight}{wxfontsetweight}


\membersection{wxFont::New}\label{wxfontnew}

\func{static wxFont *}{New}{\param{int}{ pointSize}, \param{wxFontFamily}{ family}, \param{int}{ style}, \param{wxFontWeight}{ weight},
 \param{const bool}{ underline = false}, \param{const wxString\& }{faceName = ""},
 \param{wxFontEncoding }{encoding = wxFONTENCODING\_DEFAULT}}

\func{static wxFont *}{New}{\param{int}{ pointSize}, \param{wxFontFamily}{ family},
 \param{int}{ flags = \texttt{wxFONTFLAG\_DEFAULT}}, \param{const wxString\& }{faceName = ""},
 \param{wxFontEncoding }{encoding = wxFONTENCODING\_DEFAULT}}

\func{static wxFont *}{New}{\param{const wxSize\&}{ pixelSize}, \param{wxFontFamily}{ family}, \param{int}{ style}, \param{wxFontWeight}{ weight},
 \param{const bool}{ underline = false}, \param{const wxString\& }{faceName = ""},
 \param{wxFontEncoding }{encoding = wxFONTENCODING\_DEFAULT}}

\func{static wxFont *}{New}{\param{const wxSize\&}{ pixelSize}, \param{wxFontFamily}{ family},
 \param{int}{ flags = \texttt{wxFONTFLAG\_DEFAULT}}, \param{const wxString\& }{faceName = ""},
 \param{wxFontEncoding }{encoding = wxFONTENCODING\_DEFAULT}}

These functions take the same parameters as \helpref{wxFont
constructor}{wxfontctor} and return a new font object allocated on the heap.

Using \texttt{New()} is currently the only way to directly create a font with
the given size in pixels on platforms other than wxMSW.


\membersection{wxFont::Ok}\label{wxfontok}

\constfunc{bool}{Ok}{\void}

Returns {\tt true} if this object is a valid font, {\tt false} otherwise.


\membersection{wxFont::SetDefaultEncoding}\label{wxfontsetdefaultencoding}

\func{static void}{SetDefaultEncoding}{\param{wxFontEncoding }{encoding}}

Sets the default font encoding.

\wxheading{See also}

\helpref{Font encoding overview}{wxfontencodingoverview},
\helpref{GetDefaultEncoding}{wxfontgetdefaultencoding}


\membersection{wxFont::SetFaceName}\label{wxfontsetfacename}

\func{bool}{SetFaceName}{\param{const wxString\& }{faceName}}

Sets the facename for the font.
Returns \true if the given face name exists; \false otherwise.

\wxheading{Parameters}

\docparam{faceName}{A valid facename, which should be on the end-user's system.}

\wxheading{Remarks}

To avoid portability problems, don't rely on a specific face, but specify the font family
instead or as well. A suitable font will be found on the end-user's system. If both the
family and the facename are specified, wxWidgets will first search for the specific face,
and then for a font belonging to the same family.

\wxheading{See also}

\helpref{wxFont::GetFaceName}{wxfontgetfacename}, \helpref{wxFont::SetFamily}{wxfontsetfamily}


\membersection{wxFont::SetFamily}\label{wxfontsetfamily}

\func{void}{SetFamily}{\param{wxFontFamily}{ family}}

Sets the font family.

\wxheading{Parameters}

\docparam{family}{One of:

\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf wxFONTFAMILY\_DEFAULT}}{Chooses a default font.}
\twocolitem{{\bf wxFONTFAMILY\_DECORATIVE}}{A decorative font.}
\twocolitem{{\bf wxFONTFAMILY\_ROMAN}}{A formal, serif font.}
\twocolitem{{\bf wxFONTFAMILY\_SCRIPT}}{A handwriting font.}
\twocolitem{{\bf wxFONTFAMILY\_SWISS}}{A sans-serif font.}
\twocolitem{{\bf wxFONTFAMILY\_MODERN}}{A fixed pitch font.}
\twocolitem{{\bf wxFONTFAMILY\_TELETYPE}}{A teletype font.}
\end{twocollist}}

\wxheading{See also}

\helpref{wxFont::GetFamily}{wxfontgetfamily}, \helpref{wxFont::SetFaceName}{wxfontsetfacename}


\membersection{wxFont::SetNativeFontInfo}\label{wxfontsetnativefontinfo}

\func{bool}{SetNativeFontInfo}{\param{const wxString\& }{info}}

Creates the font corresponding to the given native font description string and returns \true if
the creation was successful.
which must have been previously returned by
\helpref{GetNativeFontInfoDesc}{wxfontgetnativefontinfodesc}. If the string is
invalid, font is unchanged. This function is typically used for de-serializing a wxFont
object previously saved in a string-form.

\wxheading{See also}

\helpref{wxFont::SetNativeFontInfoUserDesc}{wxfontsetnativefontinfouserdesc}


\membersection{wxFont::SetNativeFontInfoUserDesc}\label{wxfontsetnativefontinfouserdesc}

\func{bool}{SetNativeFontInfoUserDesc}{\param{const wxString\& }{info}}

Creates the font corresponding to the given native font description string and returns \true if
the creation was successful.
Unlike \helpref{SetNativeFontInfo}{wxfontsetnativefontinfo}, this function accepts
strings which are user-friendly.
Examples of accepted string formats are:

\twocolwidtha{15cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{Generic syntax}{Example}
\twocolitem{on {\bf wxGTK2}: {\tt $[FACE-NAME]$ $[bold]$ $[oblique|italic]$ $[POINTSIZE]$}}{Monospace bold 10}
\twocolitem{on {\bf wxMSW}: {\tt $[light|bold]$ $[italic]$ $[FACE-NAME]$ $[POINTSIZE]$ $[ENCODING]$}}{Tahoma 10 WINDOWS-1252}
\twocolitem{on {\bf wxMac}: FIXME}{FIXME}
\end{twocollist}

For more detailed information about the allowed syntaxes you can look at the documentation of the native API used for font-rendering (e.g. \urlref{pango\_font\_description\_from\_string}{http://developer.gnome.org/doc/API/2.0/pango/pango-Fonts.html\#pango-font-description-from-string}).

\wxheading{See also}

\helpref{wxFont::SetNativeFontInfo}{wxfontsetnativefontinfo}



\membersection{wxFont::SetPointSize}\label{wxfontsetpointsize}

\func{void}{SetPointSize}{\param{int}{ pointSize}}

Sets the point size.

\wxheading{Parameters}

\docparam{pointSize}{Size in points.}

\wxheading{See also}

\helpref{wxFont::GetPointSize}{wxfontgetpointsize}


\membersection{wxFont::SetStyle}\label{wxfontsetstyle}

\func{void}{SetStyle}{\param{int}{ style}}

Sets the font style.

\wxheading{Parameters}

\docparam{style}{One of {\bf wxFONTSTYLE\_NORMAL}, {\bf wxFONTSTYLE\_SLANT} and {\bf wxFONTSTYLE\_ITALIC}.}

\wxheading{See also}

\helpref{wxFont::GetStyle}{wxfontgetstyle}


\membersection{wxFont::SetUnderlined}\label{wxfontsetunderlined}

\func{void}{SetUnderlined}{\param{const bool}{ underlined}}

Sets underlining.

\wxheading{Parameters}

\docparam{underlining}{true to underline, false otherwise.}

\wxheading{See also}

\helpref{wxFont::GetUnderlined}{wxfontgetunderlined}


\membersection{wxFont::SetWeight}\label{wxfontsetweight}

\func{void}{SetWeight}{\param{wxFontWeight}{ weight}}

Sets the font weight.

\wxheading{Parameters}

\docparam{weight}{One of:

\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf wxFONTWEIGHT\_NORMAL}}{Normal font.}
\twocolitem{{\bf wxFONTWEIGHT\_LIGHT}}{Light font.}
\twocolitem{{\bf wxFONTWEIGHT\_BOLD}}{Bold font.}
\end{twocollist}}

\wxheading{See also}

\helpref{wxFont::GetWeight}{wxfontgetweight}


\membersection{wxFont::operator $=$}\label{wxfontassignment}

\func{wxFont\&}{operator $=$}{\param{const wxFont\& }{font}}

Assignment operator, using reference counting. Returns a reference
to `this'.


\membersection{wxFont::operator $==$}\label{wxfontequals}

\func{bool}{operator $==$}{\param{const wxFont\& }{font}}

Equality operator. Two fonts are equal if they contain pointers
to the same underlying font data. It does not compare each attribute,
so two independently-created fonts using the same parameters will
fail the test.


\membersection{wxFont::operator $!=$}\label{wxfontnotequals}

\func{bool}{operator $!=$}{\param{const wxFont\& }{font}}

Inequality operator. Two fonts are not equal if they contain pointers
to different underlying font data. It does not compare each attribute.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?