English 中文(简体)
Getting text bounds in GTK+
原标题:
  • 时间:2010-12-07 12:04:42
  •  标签:
  • gtk
  • pango

How can I get bounds of a text, provided string with attributes say, font size, font style, and font family in GTK+?

最佳回答

For GTK+, you should probably look at Pango. I believe the required call is pango_layout_line_get_pixel_extents(), although this will of course require you to parse whatever string it is you have with the specs, and set up the corresponding Pango object before getting the extents.

问题回答

暂无回答




相关问题
Pointers in Lisp?

I ve started learning Lisp recently and wanted to write a program which uses gtk interface. I ve installed lambda-gtk bindings (on CMUCL). I want to have putpixel/getpixel ability on a pixbuf. But I ...

In Gtk, how do I make a Button with just a stock icon?

I want to create a button with the stock "Remove" icon on it, but without the text "Remove". If I use Button button = new Button(Stock.Remove);, I get the opposite: just the text, and no icon. I will ...

Using GtkMenu in Gtk+-2.14.0

I am building an application which has GtkMenu widget. I am using Glade RAD tool to develop UI and while creating project in Glade I have specified version of GTK as 2.16 which supports GtkMenu and ...

Can you set the FileFilters for a Gtk Dialog in Glade?

In my code, I have lines like this: Builder builder = new Builder(); builder.AddFromFile(gladefile); FileChooserDialog dialog = (FileChooserDialog) builder.GetObject("dialog"); FileFilter[] ...

热门标签