pango

How to fix degree symbol not showing correctly in R on Linux/Fedora 31

蓝咒 提交于 2020-03-22 04:28:10
问题 This bounty has ended . Answers to this question are eligible for a +50 reputation bounty. Bounty grace period ends in 19 hours . giocomai wants to draw more attention to this question. Any map I make with: ggplot() + geom_sf() produces the expected map, but does not show the degree sign correctly, as appears from the following picture. The answer given in this answer on SO - degree symbol incorrect in map axis labels - does not help, and I am posting a separate question as I see a different

How do you set an enum property on a GLib object?

半腔热情 提交于 2020-02-16 05:50:08
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

How do you set an enum property on a GLib object?

自闭症网瘾萝莉.ら 提交于 2020-02-16 05:49:28
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

Drawing text on GTK's DrawingArea in Haskell

被刻印的时光 ゝ 提交于 2020-01-06 02:41:15
问题 I have a DrawingArea onto which I can draw using primitives such as drawRectangle and drawLine . How do I draw text onto that area? I'm most interested in something that quickly outputs a single line of text. Graphics.UI.Gtk.Gdk.Drawable.layoutLine seems to be what I want, but it wants a Graphics.Rendering.Pango.Layout.LayoutLine as input. How do I construct that LayoutLine ? Are there better alternatives than doing it this way? Thanks! 回答1: I don't know if you would consider using Cairo. If

Fit line to width with Pango and Cairo (Pycairo)

梦想的初衷 提交于 2020-01-03 14:15:14
问题 I've several lines of text and I'd like each to fit in width (scaling the font size) to the width of the Context. Is there a way of doing this? I'm using pangocairo and python for this. 回答1: I wish to have time for a working solution, but you can start with something like: import cairo import pango import pangocairo import sys W = 500 H = int(1.4 * W) surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, W, H) context = cairo.Context(surf) #draw a background rectangle: context.rectangle(0, 0, W, H)

Change font rendering (non-antialiased) with pango

会有一股神秘感。 提交于 2020-01-03 04:49:12
问题 How do I render a string with pango using custom antialiasing and hinting settings? I tried PangoCairo.set_antialias(cairo.ANTIALIAS_NONE) (in pygtk), but it had no effect. I'd like to be able to change freetype's rendering parameters, like I can do via fontconfig/ fonts.conf , but at runtime. (This is on Linux.) Any ideas? 回答1: Well, I'm not sure if understood you right, but I usually use cairo_set_antialias () in my C-code, though I don't know an equivalent in PyGTK. As far as I understand

Pango + Cairo; is there an existing approach for handling <img> style tags in text?

心不动则不痛 提交于 2019-12-30 09:16:47
问题 Pango syntax supports some text only markup. As far as i can see this does not extend to embedding images as well. Looking around I cannot find much in the way of an existing implementation, but i havent done pango+cairo work before so i might be missing the obvious community for it. As far as i can tell a reasonable approach would be to just analyse a string, pull out any tags, create cairo images, and then modify the pango layout around them accordingly. It also seems like something someone

Pango + Cairo; is there an existing approach for handling <img> style tags in text?

↘锁芯ラ 提交于 2019-12-30 09:15:12
问题 Pango syntax supports some text only markup. As far as i can see this does not extend to embedding images as well. Looking around I cannot find much in the way of an existing implementation, but i havent done pango+cairo work before so i might be missing the obvious community for it. As far as i can tell a reasonable approach would be to just analyse a string, pull out any tags, create cairo images, and then modify the pango layout around them accordingly. It also seems like something someone

How to output lowercase strings in AwesomeWM rc.lua?

て烟熏妆下的殇ゞ 提交于 2019-12-24 09:26:09
问题 I'm using AwesomeWM vicious datewidget. I'm trying to output the date and time in wibox, in my rc.lua, with this format Feb 17, 12:10 AM (%b %d, %l:%M:%p) but I want the AM (%p) to be lowercase. I've tried: vicious.register(datewidget, vicious.widgets.date, "<span font-family='terminus' color='#999999'>%b %d, %l:%M:</span> <span variant='smallcaps'%p</span>", 1) but the variant attribute doesn't seem to work. Is there another way to do this? my full rc.lua 回答1: You can use string library's

How can I show text with different language direction in GTK+?

倖福魔咒の 提交于 2019-12-24 08:06:09
问题 I need to show some text in Arabic (which is right-to-left) and some other text in English (which is left-to-right) in the same GTK+ windows. Is there any way to set the language to the GktLabel instead of the application? 回答1: Yes, with gtk_widget_set_direction: label = gtk_label_new ("Hello World"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_container_add (GTK_CONTAINER (box), label); label = gtk_label_new ("برنامج أهلا بالعالم"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk