Font Family in GEF? [message #97632] |
Tue, 07 October 2003 01:25  |
Eclipse User |
|
|
|
Originally posted by: temp.XX.com
Hi,
I wonder if there's any font family such as Veranda, New Times Roman etc
in GEF? Hope that someone can enlighten me. Thanks!
regards,
June
|
|
|
|
|
Re: Font Family in GEF? [message #98581 is a reply to message #97823] |
Fri, 10 October 2003 22:54   |
Eclipse User |
|
|
|
Originally posted by: felix.mayer.comcast.net
I might not understand what your issue is.
For a 10 pt "Times New Roman" font with normal face, you could do this in
your org.eclipse.draw2d.Shape.outlineShape( Graphics ):
Font font = new Font( Display.getDefault(), "Times New Roman", 10,
SWT.NORMAL )
graphics.setFont( font );
graphics.drawString( "whatever", 10, 10 );
"June" <temp@xx.com> wrote in message news:bm00js$qen$1@eclipse.org...
> But the Font class allow any specification of font family. How do i
> create, for example, a New times Roman Font? I need it so that when the
> user specifies a particular font, i can display my text according...
>
> Thanks!
> regards,
> June
>
>
> Felix Mayer wrote:
>
> > Just call Graphics.setFont() with a Font that you created.
>
> > "June" <temp@XX.com> wrote in message news:bltios$e45$1@eclipse.org...
> > > Hi,
> > > I wonder if there's any font family such as Veranda, New Times Roman
etc
> > > in GEF? Hope that someone can enlighten me. Thanks!
> > >
> > > regards,
> > > June
> > >
>
>
|
|
|
|
Re: Font Family in GEF? [message #113343 is a reply to message #112948] |
Thu, 22 January 2004 17:31   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> Hi!
>
> Felix Mayer wrote:
>
> > I might not understand what your issue is.
> >
> > For a 10 pt "Times New Roman" font with normal face, you could do this
in
> > your org.eclipse.draw2d.Shape.outlineShape( Graphics ):
> >
> > Font font = new Font( Display.getDefault(), "Times New Roman", 10,
> > SWT.NORMAL )
> > graphics.setFont( font );
> > graphics.drawString( "whatever", 10, 10 );
>
> Can anyone explain what happens when calling Display.getDefault() or
> when passing "null" instead of Display.getDefault() to the Font()
> constructor?
>
> I think in both cases the current SWT UI display device will be used to
> create the font on. This is ok as long as you're painting onto a draw2D
> grpaphics that will map its output to this SWT display device.
>
In the PrinterGraphics class, we map every font from its Display version to
its Printer version. Make sure you dispose() the graphics, since that will
throw out the cache of PrinterFonts.
> But what happens e.g. while printing? Then you're painting onto a draw2d
> graphics that will not map the graphical output to the current SWT
> display device. Then the output is mapped to a diffrent (e.g. printer)
> device. But the font object then will be created for the UI display
> device, won't it?
>
>
> Regards,
>
> Holger
|
|
|
Re: Font Family in GEF? [message #114447 is a reply to message #113343] |
Wed, 28 January 2004 12:09  |
Eclipse User |
|
|
|
Originally posted by: holger.herzog.hpi.uni-potsdam.de
Randy Hudson wrote:
> In the PrinterGraphics class, we map every font from its Display version to
> its Printer version. Make sure you dispose() the graphics, since that will
> throw out the cache of PrinterFonts.
A ok, thank you. Now I got it ... it was a bit hidden via zoomFont() and
getCachedFont().
|
|
|
Powered by
FUDForum. Page generated in 0.03897 seconds