Home » Eclipse Projects » GEF » PrinterGraphics - scale text
PrinterGraphics - scale text [message #77321] |
Tue, 29 April 2003 11:45  |
Eclipse User |
|
|
|
Hello.
I am using the draw2d PrinterGraphics class to print a diagram figure.
However, when scaling, the text of my figures do not scale. (Only the
text is not scaling correctly. ) The text scaling works for the zoom
within the diagram editor.
The PrinterGraphics super class ScaledGraphics has the method
int zoomFontHeight(int height) {
return (int)(zoom * height);
}
but in PrinterGraphics this method is
int zoomFontHeight(int height) {
return height;
}
Anyone else encountering this? Could not find any bugs logged against
this.
Regards,
S.
|
|
| | | |
Re: PrinterGraphics - scale text [message #77640 is a reply to message #77485] |
Thu, 01 May 2003 10:03   |
Eclipse User |
|
|
|
Hi Martin,
I actually got around this by passing in an instance of ScaledGraphics into
PrinterGraphics, then calling scale on the scaledGraphics.
Graphics g = new SWTGraphics(gc);
scaledGraphics = new ScaledGraphics(g);
printerGraphics = new PrinterGraphics(scaledGraphics, printer);
Regards,
S.
Martin Kreutzer wrote:
> Hello,
>
> I ran into the same problem:
> Text does not scale in printing. I analysed a bit the code and found that
> the fonts are finally inherited from the current font of the canvas when do
> not explicitly set a font to a figure. Maybe this is the reason?
> I really would be interested in getting font scaling OK in printing. I
> created a PrintOperation subclass that also respects the current zoom
> setting of the viewer for print scaling in addition to the different
> resolution of the devices. It works fine, but the fonts are printed always
> in 100% scale.
>
> Regards,
>
> Martin
>
> "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
> news:b8m8bb$afd$1@rogue.oti.com...
> > Fonts are scaled for free because the height is interpreted as logic
> height,
> > not resolution of the printer.
> >
> > "S Chafe" <schafe@ca.ibm.com> wrote in message
> > news:3EAE9E22.F1DBB2F6@ca.ibm.com...
> > > Hello.
> > >
> > > I am using the draw2d PrinterGraphics class to print a diagram figure.
> > >
> > > However, when scaling, the text of my figures do not scale. (Only the
> > > text is not scaling correctly. ) The text scaling works for the zoom
> > > within the diagram editor.
> > >
> > > The PrinterGraphics super class ScaledGraphics has the method
> > >
> > > int zoomFontHeight(int height) {
> > > return (int)(zoom * height);
> > > }
> > >
> > > but in PrinterGraphics this method is
> > >
> > > int zoomFontHeight(int height) {
> > > return height;
> > > }
> > >
> > > Anyone else encountering this? Could not find any bugs logged against
> > > this.
> > >
> > > Regards,
> > > S.
> > >
> > >
> > >
> >
> >
|
|
|
Re: PrinterGraphics - scale text [message #77702 is a reply to message #77640] |
Fri, 02 May 2003 08:23   |
Eclipse User |
|
|
|
Originally posted by: martin.kreutzer.empolis.com
Hi S., Randy,
thank you for the tip. This trick solved the problem.
You find attached a print implementation which prints a grahical view with
the zoom level defined by the zoom manager. Other "zoom" levels can be set
with setZoom() before calling run().
Furthermore it prints "tile" pages when the figure does not fit on a single
page.
So this implementation has really benefits in comparison to the standard
print operations.
Best regards,
Martin
"S Chafe" <schafe@ca.ibm.com> schrieb im Newsbeitrag
news:3EB12937.BF2ECCAD@ca.ibm.com...
> Hi Martin,
>
> I actually got around this by passing in an instance of ScaledGraphics
into
> PrinterGraphics, then calling scale on the scaledGraphics.
>
> Graphics g = new SWTGraphics(gc);
> scaledGraphics = new ScaledGraphics(g);
> printerGraphics = new PrinterGraphics(scaledGraphics, printer);
>
> Regards,
> S.
>
> Martin Kreutzer wrote:
>
> > Hello,
> >
> > I ran into the same problem:
> > Text does not scale in printing. I analysed a bit the code and found
that
> > the fonts are finally inherited from the current font of the canvas when
do
> > not explicitly set a font to a figure. Maybe this is the reason?
> > I really would be interested in getting font scaling OK in printing. I
> > created a PrintOperation subclass that also respects the current zoom
> > setting of the viewer for print scaling in addition to the different
> > resolution of the devices. It works fine, but the fonts are printed
always
> > in 100% scale.
> >
> > Regards,
> >
> > Martin
> >
> > "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
> > news:b8m8bb$afd$1@rogue.oti.com...
> > > Fonts are scaled for free because the height is interpreted as logic
> > height,
> > > not resolution of the printer.
> > >
> > > "S Chafe" <schafe@ca.ibm.com> wrote in message
> > > news:3EAE9E22.F1DBB2F6@ca.ibm.com...
> > > > Hello.
> > > >
> > > > I am using the draw2d PrinterGraphics class to print a diagram
figure.
> > > >
> > > > However, when scaling, the text of my figures do not scale. (Only
the
> > > > text is not scaling correctly. ) The text scaling works for the
zoom
> > > > within the diagram editor.
> > > >
> > > > The PrinterGraphics super class ScaledGraphics has the method
> > > >
> > > > int zoomFontHeight(int height) {
> > > > return (int)(zoom * height);
> > > > }
> > > >
> > > > but in PrinterGraphics this method is
> > > >
> > > > int zoomFontHeight(int height) {
> > > > return height;
> > > > }
> > > >
> > > > Anyone else encountering this? Could not find any bugs logged
against
> > > > this.
> > > >
> > > > Regards,
> > > > S.
> > > >
> > > >
> > > >
> > >
> > >
>
|
|
|
Re: PrinterGraphics - scale text [message #77718 is a reply to message #77640] |
Fri, 02 May 2003 10:07   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You guys are missing the more important issue. We do not have a way to
reproduce the problems you are describing. Please open a bugzilla with all
relevany information. Printing works fine for me. Perhaps if I use your
workaround, Fonts will be double scaled, making them too large.
"S Chafe" <schafe@ca.ibm.com> wrote in message
news:3EB12937.BF2ECCAD@ca.ibm.com...
> Hi Martin,
>
> I actually got around this by passing in an instance of ScaledGraphics
into
> PrinterGraphics, then calling scale on the scaledGraphics.
>
> Graphics g = new SWTGraphics(gc);
> scaledGraphics = new ScaledGraphics(g);
> printerGraphics = new PrinterGraphics(scaledGraphics, printer);
>
> Regards,
> S.
>
> Martin Kreutzer wrote:
>
> > Hello,
> >
> > I ran into the same problem:
> > Text does not scale in printing. I analysed a bit the code and found
that
> > the fonts are finally inherited from the current font of the canvas when
do
> > not explicitly set a font to a figure. Maybe this is the reason?
> > I really would be interested in getting font scaling OK in printing. I
> > created a PrintOperation subclass that also respects the current zoom
> > setting of the viewer for print scaling in addition to the different
> > resolution of the devices. It works fine, but the fonts are printed
always
> > in 100% scale.
> >
> > Regards,
> >
> > Martin
> >
> > "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
> > news:b8m8bb$afd$1@rogue.oti.com...
> > > Fonts are scaled for free because the height is interpreted as logic
> > height,
> > > not resolution of the printer.
> > >
> > > "S Chafe" <schafe@ca.ibm.com> wrote in message
> > > news:3EAE9E22.F1DBB2F6@ca.ibm.com...
> > > > Hello.
> > > >
> > > > I am using the draw2d PrinterGraphics class to print a diagram
figure.
> > > >
> > > > However, when scaling, the text of my figures do not scale. (Only
the
> > > > text is not scaling correctly. ) The text scaling works for the
zoom
> > > > within the diagram editor.
> > > >
> > > > The PrinterGraphics super class ScaledGraphics has the method
> > > >
> > > > int zoomFontHeight(int height) {
> > > > return (int)(zoom * height);
> > > > }
> > > >
> > > > but in PrinterGraphics this method is
> > > >
> > > > int zoomFontHeight(int height) {
> > > > return height;
> > > > }
> > > >
> > > > Anyone else encountering this? Could not find any bugs logged
against
> > > > this.
> > > >
> > > > Regards,
> > > > S.
> > > >
> > > >
> > > >
> > >
> > >
>
|
|
| | | |
Re: PrinterGraphics - scale text [message #79650 is a reply to message #77321] |
Thu, 15 May 2003 10:39  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
PrinterGraphics has been fixed:
int zoomFontHeight(int height) {
int printerDPI = printer.getDPI().y;
int displayDPI = Display.getCurrent().getDPI().y;
double factor = zoom * displayDPI / printerDPI;
return (int)(height * factor + 0.0000001);
}
Your workaround should still work, but is no longer necessary.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=37665
"S Chafe" <schafe@ca.ibm.com> wrote in message
news:3EAE9E22.F1DBB2F6@ca.ibm.com...
> Hello.
>
> I am using the draw2d PrinterGraphics class to print a diagram figure.
>
> However, when scaling, the text of my figures do not scale. (Only the
> text is not scaling correctly. ) The text scaling works for the zoom
> within the diagram editor.
>
> The PrinterGraphics super class ScaledGraphics has the method
>
> int zoomFontHeight(int height) {
> return (int)(zoom * height);
> }
>
> but in PrinterGraphics this method is
>
> int zoomFontHeight(int height) {
> return height;
> }
>
> Anyone else encountering this? Could not find any bugs logged against
> this.
>
> Regards,
> S.
>
>
>
|
|
|
Goto Forum:
Current Time: Tue May 13 09:53:48 EDT 2025
Powered by FUDForum. Page generated in 0.04266 seconds
|