• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSPrintInfo paperSize and NSFont advancementForGlyph problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPrintInfo paperSize and NSFont advancementForGlyph problem


  • Subject: NSPrintInfo paperSize and NSFont advancementForGlyph problem
  • From: email@hidden
  • Date: Wed, 13 Oct 2004 17:17:19 -0300

Hi,

I am trying to develop a Print Preview for my software, but in order for me to
know how many characters I can display in one row, I must know the paper size,
the margins and the width size of the Font character(using a fixed size Font
like Monaco).

I already have the values calculated using:
papersize = [printInfo paperSize];
leftmargin = [printInfo leftMargin];
rightmargin = [printInfo rightMargin];
characterWidth = [font advancementForGlyph:(NSGlyph)'1'].width

Using Letter paper and Monaco 14 Font, I get the following values:
papersize.width = 612
papersize.height = 792
leftmargin = 72
rightmargin = 72
characterWidth = 8.12

Well, if I do 612 / 8 (8.12 rounded down), that gives me 76 characters per row.
So I should display only 76 characters per row, right?

What I do not understand is that when I use TextEdit, I can create a text in
which I write 80 characters per row, select the whole text and set the font to
Monaco 14, send it to the printer and the rows are printed correctly, each row
with 80 characters. How can this be possible if according to the calculations
above only 76 characters per row should be printed? What am I missing here?

Thanks for any help.
Marcos


___________________________________________________________________________________
Acesse nosso portal www.click21.com.br

Porque internet grĂ¡tis, nem a Embratel pode fazer mais barato. Mas pode fazer melhor.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: how to receive a Cocoa drag in a Carbon app using regular Drag Manager?
  • Next by Date: NSWindow ignore mouse clicks
  • Previous by thread: Re: binding options help please
  • Next by thread: Re: NSPrintInfo paperSize and NSFont advancementForGlyph problem
  • Index(es):
    • Date
    • Thread