📄 pangofc-fontmap.xml
字号:
<refentry id="PangoFcFontMap"><refmeta><refentrytitle id="top_of_page">PangoFcFontMap</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>PANGO Library</refmiscinfo></refmeta><refnamediv><refname>PangoFcFontMap</refname><refpurpose>Base fontmap class for Fontconfig-based backends</refpurpose><!--[<xref linkend="desc" endterm="desc.title"/>]--></refnamediv><refsynopsisdiv id="synopsis"><title id="synopsis.title">Synopsis</title><synopsis> <link linkend="PangoFcFontMap-struct">PangoFcFontMap</link>; <link linkend="PangoFcFontMapClass">PangoFcFontMapClass</link>;<link linkend="PangoFontDescription">PangoFontDescription</link>* <link linkend="pango-fc-font-description-from-pattern">pango_fc_font_description_from_pattern</link> (<link linkend="FcPattern">FcPattern</link> *pattern, <link linkend="gboolean">gboolean</link> include_size);<link linkend="void">void</link> <link linkend="pango-fc-font-map-cache-clear">pango_fc_font_map_cache_clear</link> (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);<link linkend="PangoContext">PangoContext</link>* <link linkend="pango-fc-font-map-create-context">pango_fc_font_map_create_context</link> (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);<link linkend="void">void</link> <link linkend="pango-fc-font-map-shutdown">pango_fc_font_map_shutdown</link> (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap);<link linkend="void">void</link> <link linkend="pango-fc-font-map-add-decoder-find-func">pango_fc_font_map_add_decoder_find_func</link> (<link linkend="PangoFcFontMap">PangoFcFontMap</link> *fcfontmap, <link linkend="PangoFcDecoderFindFunc">PangoFcDecoderFindFunc</link> findfunc, <link linkend="gpointer">gpointer</link> user_data, <link linkend="GDestroyNotify">GDestroyNotify</link> dnotify);<link linkend="PangoFcDecoder">PangoFcDecoder</link>* (<link linkend="PangoFcDecoderFindFunc">*PangoFcDecoderFindFunc</link>) (<link linkend="FcPattern">FcPattern</link> *pattern, <link linkend="gpointer">gpointer</link> user_data);</synopsis></refsynopsisdiv><refsect1 id="object_hierarchy"><title id="object_hierarchy.title">Object Hierarchy</title><synopsis> <link linkend="GObject">GObject</link> +----<link linkend="PangoFontMap">PangoFontMap</link> +----PangoFcFontMap +----<link linkend="PangoFT2FontMap">PangoFT2FontMap</link></synopsis></refsect1><refsect1 id="desc"><title id="desc.title">Description</title><para>PangoFcFontMap is a base class for font map implementations using theFontconfig and FreeType libraries. It is used in the<link linkend="pango-Xft-Fonts-and-Rendering">Xft</link> and<link linkend="pango-FreeType-Fonts-and-Rendering">FreeType</link>backends shipped with Pango, but can also be used when creatingnew backends. Any backend deriving from this base class will take advantage of the wide range of shapers implemented usingFreeType that come with Pango.</para></refsect1><refsect1 id="details"><title id="details.title">Details</title><refsect2><title><anchor id="PangoFcFontMap-struct" role="struct"/>PangoFcFontMap</title><indexterm><primary>PangoFcFontMap</primary></indexterm><programlisting>typedef struct _PangoFcFontMap PangoFcFontMap;</programlisting><para><link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link> is a base class for font map implementationsusing the Fontconfig and FreeType libraries. To create a newbackend using Fontconfig and FreeType, you derive from this classand implement a <link linkend="new-font"><function>new_font()</function></link> virtual function that creates aninstance deriving from <link linkend="PangoFcFont"><type>PangoFcFont</type></link>.</para><para></para></refsect2><refsect2><title><anchor id="PangoFcFontMapClass" role="struct"/>PangoFcFontMapClass</title><indexterm><primary>PangoFcFontMapClass</primary></indexterm><programlisting>typedef struct { /* Deprecated in favor of context_substitute */ void (*default_substitute) (PangoFcFontMap *fontmap, FcPattern *pattern); /* Deprecated in favor of create_font */ PangoFcFont *(*new_font) (PangoFcFontMap *fontmap, FcPattern *pattern); double (*get_resolution) (PangoFcFontMap *fcfontmap, PangoContext *context); gconstpointer (*context_key_get) (PangoFcFontMap *fcfontmap, PangoContext *context); gpointer (*context_key_copy) (PangoFcFontMap *fcfontmap, gconstpointer key); void (*context_key_free) (PangoFcFontMap *fcfontmap, gpointer key); guint32 (*context_key_hash) (PangoFcFontMap *fcfontmap, gconstpointer key); gboolean (*context_key_equal) (PangoFcFontMap *fcfontmap, gconstpointer key_a, gconstpointer key_b); void (*context_substitute) (PangoFcFontMap *fontmap, PangoContext *context, FcPattern *pattern); PangoFcFont *(*create_font) (PangoFcFontMap *fontmap, PangoContext *context, const PangoFontDescription *desc, FcPattern *pattern);} PangoFcFontMapClass;</programlisting><para>Class structure for <link linkend="PangoFcFontMap"><type>PangoFcFontMap</type></link>.</para><para></para><variablelist role="struct"><varlistentry><term><structfield>default_substitute</structfield> ()</term><listitem><simpara> Substitutes in default values for unspecified fields in a <link linkend="FcPattern"><type>FcPattern</type></link>. This will be called prior to creating a font for the pattern. May be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. Deprecated in favor of @<link linkend="context-substitute"><function>context_substitute()</function></link>.</simpara></listitem></varlistentry><varlistentry><term><structfield>new_font</structfield> ()</term><listitem><simpara> Creates a new <link linkend="PangoFcFont"><type>PangoFcFont</type></link> for the specified pattern of the appropriate type for this font map. The <parameter>pattern</parameter> argument must be passed to the "pattern" property of <link linkend="PangoFcFont"><type>PangoFcFont</type></link> when you call <link linkend="g-object-new"><function>g_object_new()</function></link>. Deprecated in favor of @<link linkend="create-font"><function>create_font()</function></link>.</simpara></listitem></varlistentry><varlistentry><term><structfield>get_resolution</structfield> ()</term><listitem><simpara> Gets the resolution (the scale factor between logical and absolute font sizes) that the backend will use for a particular fontmap and context. <parameter>context</parameter> may be null.</simpara></listitem></varlistentry><varlistentry><term><structfield>context_key_get</structfield> ()</term><listitem><simpara> Gets an opaque key holding backend specific options for the context that will affect fonts created by <link linkend="create-font"><function>create_font()</function></link>. The result must point to persistant storage owned by the fontmap. This key is used to index hash tables used to look up fontsets and fonts.</simpara></listitem></varlistentry><varlistentry><term><structfield>context_key_copy</structfield> ()</term><listitem><simpara> Copies a context key. Pango uses this to make a persistant copy of the value returned from <parameter>context_key_get</parameter>.</simpara></listitem></varlistentry><varlistentry><term><structfield>context_key_free</structfield> ()</term><listitem><simpara> Frees a context key copied with <parameter>context_key_copy</parameter>.</simpara></listitem></varlistentry><varlistentry><term><structfield>context_key_hash</structfield> ()</term><listitem><simpara> Gets a hash value for a context key</simpara></listitem></varlistentry><varlistentry><term><structfield>context_key_equal</structfield> ()</term>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -