|
-
February 16th, 2011, 08:16 PM
#16
Re: Font Help
Guess that either my calculations are incorrect or I have compounded rounding of values which I can't seem to locate.
When you output the text to the DC what function do you use?
Do have an example I could review?
The errors seem to be larger the lower the resoluton used when comparing printer and display outputs.
Please advise of solution it makes it easier to find an answer.
-
February 16th, 2011, 08:41 PM
#17
Re: Font Help
 Originally Posted by sma
Guess that either my calculations are incorrect or I have compounded rounding of values which I can't seem to locate.
When you output the text to the DC what function do you use?
Do have an example I could review?
The errors seem to be larger the lower the resoluton used when comparing printer and display outputs.
Ck your PM inbox...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 16th, 2011, 08:56 PM
#18
Re: Font Help
Thank you for the code, I think that my issue is with the use of the MM_TEXT mapping which means 1 pixel = 1 logical unit which is not of a high enough resolution to make my results accurate.
The use of MM_HIENGLISH means that the logical unit is mapped to represent 0.001 inches which means any calculations will be more accurate less rounding errors.
Unfortunately it means that my drawing algorithms now need modifying to reverse the Y coordinates as +ve now means up.
Also what Text drawing function do you use, textout, exttextout, drawtext etc?
Also from your code you have effectively scaling factors used with each resolution are the standard or something you have determined yourself?
Thanks for your help on this I will let you know how I get on.
Please advise of solution it makes it easier to find an answer.
-
February 16th, 2011, 11:07 PM
#19
Re: Font Help
 Originally Posted by sma
Also what Text drawing function do you use, textout, exttextout, drawtext etc?
Also from your code you have effectively scaling factors used with each resolution are the standard or something you have determined yourself?
Thanks for your help on this I will let you know how I get on.
I use TextOut() unless I need to do a WordBreak then I use DrawText()...
The scaling factor was from hours of rough calc's then fine tuning with hundred of pages printed and faxed...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 16th, 2011, 11:21 PM
#20
Re: Font Help
Changed over to use MapMode MM_HIGHENGLISH
No luck or improvement.
Distance over 33 Lines:
Word = 127.94
App HIGHENGLISH = 117.98
App TEXT = 119.33
Measured I
Word = 2.12mm close enough to your measurements.
App HIGHENGLISH = 2.12mm
App TEXT = 2.12m
Please advise of solution it makes it easier to find an answer.
-
February 16th, 2011, 11:29 PM
#21
Re: Font Help
 Originally Posted by sma
Changed over to use MapMode MM_HIGHENGLISH
No luck or improvement.
Distance over 33 Lines:
Word = 127.94
App HIGHENGLISH = 117.98
App TEXT = 119.33
Measured I
Word = 2.12mm close enough to your measurements.
App HIGHENGLISH = 2.12mm
App TEXT = 2.12m
If font height is the same then I would look for the problem in the line spacing...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 16th, 2011, 11:38 PM
#22
Re: Font Help
Looking at this if difference =9.96mm ofver 33 lines then extra spacing =0.31125mm.
Which using HIENGLISH = 0.01225' = where 1 logical unit = 0.001' then we need to add 12.25 logical units.
I will add this between the characters and give it a try.
Please advise of solution it makes it easier to find an answer.
-
February 16th, 2011, 11:42 PM
#23
Re: Font Help
 Originally Posted by sma
Looking at this if difference =9.96mm ofver 33 lines then extra spacing =0.31125mm.
Which using HIENGLISH = 0.01225' = where 1 logical unit = 0.001' then we need to add 12.25 logical units.
I will add this between the characters and give it a try.
if that doesn't work you can email me printing code and I'll take a look..
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 16th, 2011, 11:49 PM
#24
Re: Font Help
How are you calculating the next line Y spacing ?
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 16th, 2011, 11:54 PM
#25
Re: Font Help
Yes, I am using GetTextExtent to obtain the line height, just looking at Word to see if there is a default line spacing which is added to each line of text. On the paragraph options there is an ability to include additional line spacing so I guess it may be defaulting to this whenthe RTF is opened and printed.
This still leaves me with the issue of providing an accurate screen representation. With the fix for the printing the screen rendering of the text still exceeds the screen. Might need to scale the screen representation to suit.
Please advise of solution it makes it easier to find an answer.
-
February 17th, 2011, 12:00 AM
#26
Re: Font Help
In your code here...you are adding .5 could this be why it is printing long ?
Code:
float PixelsInch = (((float)VertRes / (float)Height) * 25.4) + 0.5;
Last edited by Vanaj; February 17th, 2011 at 12:12 AM.
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 17th, 2011, 12:10 AM
#27
Re: Font Help
The code you referenced was an attempt to reduce the rounding errors during the calculation of a font. The 0.5 was added to ensure the number of pixels was always round up which is also performed by the MulDiv function. This method was extracted from a Windows Graphics Programming reference book I have.
After changing the code to use MM_HIGHENGLISH I nolonger use this function to calculate the required sizes.
I've changed the printed font back to 8pt from the 10 I was doing all the measurements on and now the line spacing is too much however I think it is a proportion of the size of the font. TextExtent.cy @ 10pt = 134 so I think I only need to multiply this by a factor of 0.1 to find the additional line spacing required.
As for the sceen representation I can scale this to suit and manipulate the overall page size.
Please advise of solution it makes it easier to find an answer.
-
February 17th, 2011, 12:19 AM
#28
Re: Font Help
There has to be some logical reason in the code for the size difference as you shouldn't have to multiply the cy by a .1 to get correct/matching line spacing...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
February 17th, 2011, 12:29 AM
#29
Re: Font Help
Looking a bit further:
Word has a minimum line spacing for paragraphs and this has been identified a 6pt on the systems here.
I can't tell you if this includes the external leading element of the font or not however when you try to set this value to 0 in word it stipulates that this value can not be less than 0.7pt.
Anyway, I think we have found the source of the problem and as the font size varies this additional line spacing also varies so I have tailored the height value to a factor of 1.08.
Once again thank you for your assistance.
Please advise of solution it makes it easier to find an answer.
-
February 17th, 2011, 12:32 AM
#30
Re: Font Help
No problem...hope it helped in some way...
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|