How to set font from file in Pango and Mono -


i have simple application prints text , determines size in pixels.

static void main(string[] args) {     application.init();      var screen = screen.default;     var layout = new pango.layout(pangohelper.contextgetforscreen(screen));      layout.fontdescription = new fontdescription();     layout.fontdescription.family = "times new roman";     layout.fontdescription.size = units.frompixels(18);      layout.settext("my text");      int width;     int height;      layout.getpixelsize(out width, out height);      console.writeline("{0} - width:{1} height:{2}", layout.text, width, height);     console.readline(); } 

but want use own font. how can load own font file , use in pango in mono?

short answer is: can't use uninstalled fonts pango. :(

longer answer is: can, if using fontconfig backend (pangofc; eg on linux). in case need make few calls fontconfig before using pango, make fonts available fontconfig. however, don't think fontconfig has mono bindings.

so, i'm afraid you're out of luck here.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -