Currently we can't use Pango for just about anything. Yet, it's almost fully wrapped and sitting there looking like it's working. But I'm quite sure that there is only one .html of functions that are left to wrap, so that we can get better font rendering with Pango and Cairo.
In APILookupPango.txt there's these mysterious lines:
#file: pango-Cairo-Rendering.html
#struct: PangoCairoFontMap
#class: PgCairoFontMap
#prefix: pango_cairo_font_map_
#strictPrefix: Yes
#outFile: PgCairoFontMap
#class: PgCairo
#prefix: pango_cairo_
#noprefix: pango_cairo_font_map_
#outFile: PgCairo
It looks like someone has started to wrap it at some point. I think it's propably easy to add the missing lines there and wrap those things inside a pango.PgCairo?.d file. It seems that it has got many classes that are needed, and I'm not sure if that's possible with gtkDwrap. (If it isn't possible yet, then the PgCairoFontMap? and PgCairoFont? classes should just be ignored for the time being.) All of the functions in class PgCairo? are going to be static.
All the Cairo text examples on the net tell us that we mustn't use the cairo.Context.showText() method, because that's the "toy API" for rendering text. Yet, all those same examples use it anyway. I was able to find one C example of how to use Pango and Cairo together. Here's an approximate D version that might actually work, after the wrap has been made:
import cairo.Context;
import pango.PgLayout;
import pango.PgFontDescription;
import pango.PgCairo;
void pangoCairoText( Context cr, char[] set_text )
{
PgLayout pLayout = PgCairo.createLayout(cr);
PgFontDescription pDesc = new PgFontDescription();
pDesc.setAbsoluteSize(120.0);
pDesc.setFamily("DejaVu LGC Sans Mono");
pDesc.setWeight( PangoWeight.SEMIBOLD );//NORMAL
pDesc.setStyle( PangoStyle.NORMAL );
pLayout.setFontDescription( pDesc );
pLayout.setText( set_text );
//cr.setOperator( cairo_operator_t.OVER );
cr.setLineWidth( 0.0025f );
cr.moveTo( 0.1f, 0.5f );
PgCairo.layoutPath( cr, pLayout );
cr.setSourceRgba( 0.0f, 0.0f, 0.0f, 1.0f );
cr.fill();
}
So, please. Somebody wrap PangoCairo?!