[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: CC: Re: "new" wp for linux
From:       James Richard Tyrer <tyrerj () acm ! org>
Date:       2004-04-13 23:45:35
Message-ID: 407C7B9F.1090408 () acm ! org
[Download RAW message or body]

David Faure wrote:
> On Wednesday 14 April 2004 00:09, Tomasz Grobelny wrote:
> 
> > On Tuesday 13 of April 2004 23:34, James Richard Tyrer wrote:
> > 
> > > There is an additional issue with Printer rendering that KWord and/or Qt
> > > must know the resolution of the printer.
> > > My best guess is that KWord-1.3 is currently using Printer rendering so
> > > there are still slight problems.
> > 
> > I doubt it since Qt prints through postscript files and that means it has no 
> > knowledge about destination printer.
> 
> There are case where you can find the resolution of the destination printer
> (via QPrinter or KPrinter), but that doesn't always help anyway (worst example
> is printing to a .ps file and then printing to any printer you want).

That is the way that Windows works.  I don't know exactly how WordPerfect 
works -- I do know that it knows the resolution of the printer when it does 
the page layout.  What I would really like to know is how GhostScript 
renders fonts.  Does it hint them to the printer DPI or does it use the 
unhinted glyph size?

> Lars suggested to just use a high enough DPI so that it looks ok on
> any printer - if we get it to work we could even make it configurable,
> to differenciate between normal office use (600 DPI?) and professional
> use (1200 DPI or more).

It theory this is correct.  In the limit as DPI goes to infinity there 
would be no difference in size between a hinted and unhinted glyph.

> But I tried doing that long ago in KWord and it didn't work well with
> embedded objects, since it requires that all koffice applications really
> support zooming (in paintContent at least) so that one can zoom out
> after setting the DPI to a very high value (to end up with the right
> size after all).
> 

> > > That is, for KWord to work correctly, Qt needs to add what I have called
> > > PostScript font rendering.
> > 
> > And that means redesigning entire set of painting/font classes :-(. Why? 
> > Because:
> > -Qt sets fixed width of strings in postscript files,
> 
> What else would it do?
> 
Other word processors do this differently.

WordPerfect has this:

/Times-RomanR 600 ff
17 0 32 (The quick brown fox jumps over the fat lazy dog.)W

I don't know exactly what this does.  Some other fonts use: "S" rather 
than: "W" and don't have the three numbers at the start.

But KWord has a line length at the end of the line:

F5 F
13 
Y<0001000200030004000500060007000800090004000A000B000C000D000E0004000F000C001000040011 \
00060012001300140004000C00150003000B00040016000200030004000F001700160004001800170019001A0004001B000C001C001D>322 \
 0 AT

That is: '322" is the line length in points.

So, my best guess is that WordPerfect simply lets GhostScript render the 
fonts based on the unhinted glyph metrics in the font file.

OTOH, OpenOffice does this:

(Times-Roman-iso1252) cvn findfont 50 -50 matrix scale makefont setfont
<54686520717569636B2062726F776E20666F78206A756D7073206F766572207468652066617420
6C617A7920646F672E>
[31 25 22 12 25 25 14 22 25 13 25 16 25 36 25 13 16 25 25 13 14 25 39 25 19 
13 25
  25 22 16 13 14 25 22 12 17 22 14 12 14 22 22 25 13 25 25 25 0]
xshow

Which appears to be data to fudge the spacing, but no line length.

> 
> > -QFont(Metrics) gives inaccurate metrics information,
> 
> That's what I hope Qt4 fixes.
> 
Actually it uses the font metrics based on the glyph hinted to the screen 
resolution (WYGIWYS rather than WYSIWYG).
> 
> > -you can't order Qt to use only scalable fonts
> 
> Actually Lars said ForceOutline should do that, and if it doesn't do it
> then it's a bug. We use ForceOutline in kotext, not sure if it makes
> a difference though.

I think that setting StyleStrategy to ForceOutline forces it to use only 
scalable fonts when searching for a font.

So, yes you can order Qt to use only scalable fonts.  The problem is that 
you can't order it to use the unhinted font metrics for page layout.

--
JRT
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic