summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--docs/pango-sections.txt1
-rw-r--r--docs/tmpl/pangofc-fontmap.sgml7
-rw-r--r--pango/pangofc-fontmap.c5
-rw-r--r--pango/pangofc-fontmap.h20
-rw-r--r--pango/pangoft2-fontmap.c2
-rw-r--r--pango/pangoxft-fontmap.c2
7 files changed, 46 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ca235f00..1a8340e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2008-12-07 Behdad Esfahbod <behdad@gnome.org>
+ Bug 563557 – set g_get_prgname() in fc pattern
+
+ * docs/pango-sections.txt:
+ * pango/pangofc-fontmap.c (pango_fc_make_pattern):
+ * pango/pangofc-fontmap.h:
+ Add PANGO_FC_PRGNAME which is the fontconfig element "pangoprgname".
+ Populate it on all our fontconfig search patterns using
+ g_get_prgname(). See bug for sample use.
+
+2008-12-07 Behdad Esfahbod <behdad@gnome.org>
+
* pango/pango-engine.h: Add G_MODULE_EXPORT annotation for modules.
2008-12-07 Behdad Esfahbod <behdad@gnome.org>
diff --git a/docs/pango-sections.txt b/docs/pango-sections.txt
index c5b47c67..ec33700d 100644
--- a/docs/pango-sections.txt
+++ b/docs/pango-sections.txt
@@ -922,6 +922,7 @@ pango_fc_font_map_shutdown
pango_fc_font_description_from_pattern
PANGO_FC_GRAVITY
PANGO_FC_VERSION
+PANGO_FC_PRGNAME
<SUBSECTION Standard>
PANGO_FC_FONT_MAP
PANGO_IS_FC_FONT_MAP
diff --git a/docs/tmpl/pangofc-fontmap.sgml b/docs/tmpl/pangofc-fontmap.sgml
index 02891c78..5d85676c 100644
--- a/docs/tmpl/pangofc-fontmap.sgml
+++ b/docs/tmpl/pangofc-fontmap.sgml
@@ -126,3 +126,10 @@ Fontconfig-based backend involves deriving from both
+<!-- ##### MACRO PANGO_FC_PRGNAME ##### -->
+<para>
+
+</para>
+
+
+
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 4bb51885..5c5dbe58 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -800,6 +800,7 @@ pango_fc_make_pattern (const PangoFontDescription *description,
double dpi)
{
FcPattern *pattern;
+ const char *prgname;
int slant;
int weight;
PangoGravity gravity;
@@ -810,6 +811,7 @@ pango_fc_make_pattern (const PangoFontDescription *description,
int width;
#endif
+ prgname = g_get_prgname ();
slant = pango_fc_convert_slant_to_fc (pango_font_description_get_style (description));
weight = pango_fc_convert_weight_to_fc (pango_font_description_get_weight (description));
#ifdef FC_WIDTH
@@ -857,6 +859,9 @@ pango_fc_make_pattern (const PangoFontDescription *description,
FcPatternAddString (pattern, PANGO_FC_GRAVITY, value->value_nick);
}
+ if (prgname)
+ FcPatternAddString (pattern, PANGO_FC_PRGNAME, prgname);
+
return pattern;
}
diff --git a/pango/pangofc-fontmap.h b/pango/pangofc-fontmap.h
index d50563ef..fe1e1b5b 100644
--- a/pango/pangofc-fontmap.h
+++ b/pango/pangofc-fontmap.h
@@ -183,6 +183,8 @@ PangoFontDescription *pango_fc_font_description_from_pattern (FcPattern *pattern
* than %PangoGravitySouth is desired.
*
* The property will have a #PangoGravity value as a string, like "east".
+ * This can be used to write fontconfig configuration rules to choose
+ * different fonts for horizontal and vertical writing directions.
*
* Since: 1.20
*/
@@ -196,11 +198,29 @@ PangoFontDescription *pango_fc_font_description_from_pattern (FcPattern *pattern
*
* The property will have an integer value equal to what
* pango_version() returns.
+ * This can be used to write fontconfig configuration rules that only affect
+ * certain pango versions (or only pango-using applications, or only
+ * non-pango-using applications).
*
* Since: 1.20
*/
#define PANGO_FC_VERSION "pangoversion"
+/**
+ * PANGO_FC_PRGNAME:
+ *
+ * String representing a fontconfig property name that Pango sets on any
+ * fontconfig pattern it passes to fontconfig.
+ *
+ * The property will have a string equal to what
+ * g_get_prgname() returns.
+ * This can be used to write fontconfig configuration rules that only affect
+ * certain applications.
+ *
+ * Since: 1.24
+ */
+#define PANGO_FC_PRGNAME "pangoprgname"
+
G_END_DECLS
#endif /* __PANGO_FC_FONT_MAP_H__ */
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index 44b28266..143be802 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -311,7 +311,7 @@ _pango_ft2_font_map_get_library (PangoFontMap *fontmap)
*
* Gets the singleton PangoFT2Renderer for this fontmap.
*
- * Return value:
+ * Return value: the renderer.
**/
PangoRenderer *
_pango_ft2_font_map_get_renderer (PangoFT2FontMap *ft2fontmap)
diff --git a/pango/pangoxft-fontmap.c b/pango/pangoxft-fontmap.c
index 526998a9..7047b214 100644
--- a/pango/pangoxft-fontmap.c
+++ b/pango/pangoxft-fontmap.c
@@ -337,7 +337,7 @@ pango_xft_get_context (Display *display,
*
* Gets the singleton #PangoXFTRenderer for this fontmap.
*
- * Return value:
+ * Return value: the renderer.
**/
PangoRenderer *
_pango_xft_font_map_get_renderer (PangoXftFontMap *xftfontmap)