FROM : mbdecastro
DATE : Wed Oct 13 22:17:19 2004
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.
DATE : Wed Oct 13 22:17:19 2004
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.
| Related mails | Author | Date |
|---|---|---|
| mbdecastro | Oct 13, 22:17 | |
| mbdecastro | Oct 13, 23:59 |






Cocoa mail archive

