Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, January 31, 2008

Why did Pages' characters look blurry?

With Pages 3.0 and earlier, many users perceived problems with blurriness around the characters. With Pages '09/Pages 4.0 Apple changed the way fonts are rendered, which makes them look darker or sharper than they did before.

The word below is written using Helvetica 10 and rendered at 100% size. The top rendering is Pages '09 and the lower one is Pages 3.0. Surprisingly the top rendering looks better on an LCD screen than the lower one.



This uses the default setting in System Preferences > Appearance > Font smoothing style. With Pages '09, this setting is taken into account, unlike previous versions.

If you want to turn font smoothing off, open a terminal window and use the command
defaults write com.apple.iWork.Pages SFRFontSmoothing 0
If you want to turn it back on, use the command
defaults write com.apple.iWork.Pages SFRFontSmoothing 1
The text below was written for previous versions. It contains more explanations of what was wrong.
---

Most letters have some round curves, and that is a problem, as current computer screens consist of a lot of small dots, not curves.

The process of mapping the round curves of letters to pixels is called font rasterisation. There are different strategies to do it.

Last millennium one of the most common strategies was to simply put black dots in logical places. AppleWorks uses that method, and the result is that the letters get very rough edges. Here is the word "lollipop" written in Helvetica, 10 in AppleWorks. It is magnified about 10 times, so you can see the pixels.
The next strategy was to use anti-aliasing. That means that you add pixels of different shades of grey to increase the illusion that the letters are curved. It looks ridiculous when you magnify it, but when the font is small, it is surprisingly efficient. It is very likely that your web brower uses anti-aliasing to display the characters you read right now. Magnified, the characters do not look very legible:

But on a screen, it does not look quite that bad:


This is still the most efficient strategy, if you have a CRT (Cathode ray tube) screen. It is also the method Pages uses. However, fewer and fewer people use CRT screens nowadays.

For LCD screens, the best strategy is usually subpixel rendering. This uses the fact that each pixel on an LCD screen consists of three small elements, one red, one green and one blue. Looking at a magnified image of these pixels gives the impression that it is almost illegible. However, when one takes into account that the colour elements are at different positions inside each pixel, it is easier to understand that this can actually be easier to read than plain anti-aliased text.

On the screen it looks a little better. Keep in mind that this is my screen magnified about 10 times.

As you can see, the monitor does not simply display the colours right off, but there is some algorithm how to display it correctly.

To some people this gives a much clearer picture. To others it is mostly annoying, as they are able to see the different colours, in spite of the small size. This is a technology used by for example TextEdit and MS Word for Mac. Your browser may also use it.

Using System Preferences > Appearance, you can change this setting for TextEdit and Microsoft Word and many other applications. If you choose CRT, you disable the subpixel rendering in the applications.
However, these settings hardly change anything at all for Pages.

Why does Pages not allow subpixel rendering? The most convincing explanation may be that it is more difficult to implement in Pages than in other applications, as text can be transparent against a coloured background. It would be very difficult to choose how to handle transparent coloured pixels, when the background changes colour.

Besides, the number of pixels per inch increases all the time with more modern screens. In the near future, it will not matter much which technology is used to map curves to pixels.

So, what can one do, if one thinks Pages displays too blurry characters on the screen today?

Not much. One can either get used to it or buy a new screen with higher resolution or simply increase the zoom.

If you want to learn more about font rendering in Mac OS X, here is a list of facts and opinions on the subject:
And after Pages '09

Wednesday, October 10, 2007

Is there a Pages Viewer for Windows?

No.

If you only have a Pages document and a Windows PC, it is very difficult to see the Pages document as the author intended it. You have only two options:

1. Get a Mac with Pages, or call the original creator of the document and have the Pages document saved in a format that can be read on Windows. That usually means Word or PDF. If you want to edit the document on Windows, only Word or RTF formats work. RTF files with images and tables are not supported.

2. If the file was saved as a package, you can look at the files inside the Pages document directory and try to make something out of the different pictures and xml files that are there. You may at least get an idea what the document is about. If the author set the checkbox "Include preview in document", when the file was originally saved, this may work out reasonably well.

If you want to see what the Windows user will see in a Pages document you can control-click on the file in the Finder and Show Package contents.



You will see the included images and other files in their directory structure. If you clicked the checkbox "Include preview in document" when you saved the file, you will even get a PDF file with all the text and some very compressed pictures in the QuickLook folder.



Anyhow, there is currently only one application that can open Pages files, and that is Pages.

(The situation is the same for Numbers and Keynote documents. There is no available reader for Windows.)

Saturday, September 29, 2007

Why does the layout change when I import a Word document?



When you import (or export) a Word document, the layouts in Pages and MS Word are not identical. Some things do not simply transfer, as described here.

However, even when all present document features are supported in both programs, the layout may differ.

Text that fits on one page in one application may not do so in the other. Still, all the metrics is the same: font, font size, line spacing, character spacing, and so on.

If you look closely on the picture above, you will see that the characters have the same height in both applications, but the space between the lines is slightly off.

My guess is that this is for the historical reasons described in this article. MacOS and Windows calculate the line height in slightly different ways. MacOS uses the variables Ascender, Descender and LineGap, while most Windows applications use usWinAscent and usWinDescent. The variables mean almost the same thing, but not quite. There is more information in this article from Adobe.

MS Word needs to be 100% compatible with the layout of Word for Windows. It is MS Word, after all. And Pages clearly needs to use the MacOS way of doing things. The result is that the lines do not have exactly the same height.

Monday, December 11, 2006

How can I embed sounds or movies in a document for Windows users?

In Pages 3.0 you cannot. In Pages 2.0 there was a cumbersome and not elegant way to do it with HTML export.

Exporting to pdf or rtf will not embed movies or sounds.

Exporting to Word will link the movie/sound to the document, so it will play fine on your own computer. However, if you transfer it to another Mac, you will have to transfer the movie/sound as well as a separate file.

And even if you send both Word document and movie/sound to the Windows user as two separate files, it may not play on Windows. The help for MS Office 2004 for MacOS X says "Compatibility Report: Inserted QuickTime movies might not appear in Office for Windows."

Friday, December 08, 2006

Sharing Pages documents with MS Word users with or without using the Export command

If someone tells you to use Pages to edit Word documents, I'm afraid you got bad advice. Pages has many features that will not show up in Word documents, and Word has many features that will not show up in Pages documents.

Pages is not built to edit Word documents, which is why you have to Export to Word format and cannot Save. You may like it or not, but that's the way things are.

If you are dead set on using Pages for your MS Word documents, there is a hack at Lee Findlow's site.

Otherwise try OpenOffice and NeoOffice. They are both free. If you do not like them, but prefer something that looks and feels more like MS Word, try MS Word.

Saturday, November 04, 2006

How do I password protect a document?

From Pages '09, you set the password in the Document Inspector's Document pane.

In previous versions, you could not do it from Pages itself. The following describes ways to handle the problem with previous versions of Pages.

The safest way is to create an encrypted disk image using Applications > Utilities > Disk Utility, and put your document on that one. You get 128 bits encryption, which should be good enough for most purposes. Apple has more detailed instructions.

Using an encrypted disk image is more convenient than many people at first assume. It is high security. It is one password. And you can put a large number of different files on it (Pages, Numbers, pictures, mp3s...).

At first glance MS Word encryption seems simpler - just add a password to the document itself. However, it is not to be trusted. According to Microsoft themselves their passwords for file modification is not a security feature. It is a collaboration feature, and it can easily be hacked. According to Lastbit, no MS Office passwords before MS Office 2007 were secure. And with MS Office 2007, only the passwords for opening a document a document are safe.

From Pages you can get some kind of a Windows-compatible password protection by printing the document to PDF and encrypt it. However, neither you nor the reader will be able to easily modify the document. The encryption in the first versions of Leopard and earlier is just 40 bits RC4, which means it can be cracked with some patience. However, from Security Update 2008-002 (early 2008), the encryption is 128 bits RC4, which should be safe enough for most of us.

You could also use standard file system security (File > Get Info in the Finder), but any other user of the Mac with admin rights will be able to get to the file fairly easily. This kind of security is useless if you put the file on a memory stick or send it over the internet.

Also remember that no security mechanism is safer than the password you choose. If you choose "password" or the file name as password, it is easy for anyone to guess it and access the file content.

I have one thousand Pages documents to give to someone with Windows. How do I convert them all?

Open Applications > Applescript > Script Editor.

If you have Pages 3.0 and Mac OS X 10.5 (Leopard) create a new script and paste the following code:

on open theFiles
tell application "Pages"
repeat with aFile in theFiles
open aFile
set docName to name of front document
-- Remove .pages extension.
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to ".pages"
-- Add .doc extension.
set docName to first text item of docName & ".doc"
set AppleScript's text item delimiters to prevTIDs
-- Save file to Desktop.
set docPathAndName to (path to desktop as string) & docName
save front document as "SLDocumentTypeMSWord" in docPathAndName
close front document
end repeat
end tell
end open

If you instead have Pages 2.0 and Mac OS X 10.4 (Tiger) create a new script and paste the following code:

on open theFiles
tell application "Pages"
repeat with aFile in theFiles
open aFile
set docName to name of front document
-- Remove .pages extension.
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to ".pages"
-- Add .doc extension.
set docName to first text item of docName & ".doc"
set AppleScript's text item delimiters to prevTIDs
-- Save file to Desktop.
set docPathAndName to (path to desktop as string) & docName
save front document as ".doc" in docPathAndName
close front document
end repeat
end tell
end open

In both cases, save the script as an "Application".

Drag your 1000 Pages documents to the new file.

Sit back and wait for all the files to be processed.

Part of this code written by Dale Gillard of dmg software. Thanks Dale!

In case you wonder where the document type "SLDocumentTypeMSWord" is defined, it can be found in the Pages package Contents/Info.plist. Look for the node CFBundleDocumentTypes and number 6. The other numbers refer to other document types you also can use in this kind of script.

In case you want to convert AppleWorks documents to Pages, Yvan Koenig published an AppleScript to do just that at Apple's discussion forums.

In case you want to convert to PDF instead of MS Word, you can easily change the scripts above to do just that. If you are on Mac OS X 10.4, replace ".doc" with ".pdf". If you are on Mac OS X 10.5, replace "SLDocumentTypeMSWord" with "SLDocumentTypePDF". You can also use this script by Yvan Koenig.

If you want to export all files in a folder back to the same folder can also use the script by Yvan Koenig.