Hey Mark,

You can't directly call for a particular TTF font. Instead you should
specify a font family name that gets matched by the font. For WRasterImage,
true type fonts are only available if you have linked Wt against libpango.

In that case, font matching is done by 'fontconfig'. So you need to have
installed the font in some directory support by fontconfig, and
subsequently you should be able to match by the code above.

Regards,
koen

2014-09-01 14:03 GMT+02:00 Mark Petryk <m...@lorimarksolutions.com>:

> I have an app whereby I wish to over-print an existing .png file with
> text using a particular font.  From ubuntu, I have installed my .ttf
> file but I am unclear how to call upon this font during drawText.  Here
> is my code;
>
> >     virtual void paintEvent( Wt::WPaintDevice * paintDevice )
> >     {
> >       WPainter painter(paintDevice);
> >
> >       WPainter::Image image( "FM-1003.png",1275,1650 );
> >
> >       painter.drawImage( 0.0, 0.0, image );
> >
> >       font.setFamily( WFont::Cursive, "'Delphine'" );
> >       font.setSize(18);
> >       painter.setFont( font );
> >       painter.setPen( WPen(Wt::red) );
> >       painter.drawText( 50,250,100,100,Wt::AlignLeft,"John Q. Nobody");
> >
>
> The font I'm interested in is here;
>
> > http://sjfonts.sourceforge.net/
>
>
> --
> ~mark
>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds.  Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to