After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702016 - ClutterText reset font when dpi changes and font was set using a pango description
ClutterText reset font when dpi changes and font was set using a pango descri...
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: ClutterText
1.14.x
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-11 14:34 UTC by Lionel Landwerlin
Modified: 2013-06-12 14:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
clutter-text: prevent reset of user set font descriptions on dpi changes (1.13 KB, patch)
2013-06-11 14:37 UTC, Lionel Landwerlin
reviewed Details | Review
clutter-text: prevent reset of user set font descriptions on dpi changes (2.53 KB, patch)
2013-06-12 10:23 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2013-06-11 14:34:13 UTC
When setting the font using clutter_text_set_font_description(), the font settings on a ClutterText actor can be reset when there is a dpi changes signaled by the backend.
Comment 1 Lionel Landwerlin 2013-06-11 14:37:16 UTC
Created attachment 246534 [details] [review]
clutter-text: prevent reset of user set font descriptions on dpi changes
Comment 2 Emmanuele Bassi (:ebassi) 2013-06-11 15:55:04 UTC
Review of attachment 246534 [details] [review]:

::: clutter/clutter-text.c
@@ +4925,3 @@
+
+  if (font_desc != NULL)
+    priv->is_default_font = FALSE;

we can probably do something like:

  priv->is_default_font = (font_desc == NULL);

instead of the if...else...

to be fair, though, I'd probably move this inside the set_font_description_internal() method.
Comment 3 Lionel Landwerlin 2013-06-12 10:23:01 UTC
Created attachment 246603 [details] [review]
clutter-text: prevent reset of user set font descriptions on dpi changes
Comment 4 Emmanuele Bassi (:ebassi) 2013-06-12 11:03:04 UTC
Review of attachment 246603 [details] [review]:

looks okay to me, except a style issue (which would raise a compiler warning).

::: clutter/clutter-text.c
@@ +4921,3 @@
                                    PangoFontDescription *font_desc)
 {
+  ClutterTextPrivate *priv;

this declaration is unused.

@@ +4925,3 @@
   g_return_if_fail (CLUTTER_IS_TEXT (self));
 
+  priv = self->priv;

this assignment is unused.
Comment 5 Lionel Landwerlin 2013-06-12 14:59:20 UTC
Committed.