Recent

Author Topic: Font Size in decimals  (Read 3767 times)

martinrame

  • Full Member
  • ***
  • Posts: 121
Font Size in decimals
« on: January 05, 2013, 11:41:10 am »
Hi, I'm creating a "Print Preview" image using BGRABitmap, and noted FontSize is defined in Integer, this is causing the text doesn't look accurate, compared to the final printed page.

For example, when I zoom to 100% and font is, for example 20, it looks ok. If I zoom out to 20%, font size is, say 4. If I continue zooming out, to 19%, font changes to 3, when it would be great to change to 3.95, for example. (I didn't made real calcs here, this is just an example).

Do you know a workaround for this?.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Font Size in decimals
« Reply #1 on: January 05, 2013, 12:10:11 pm »
Do you know a workaround for this?.
Write a decently high resolution page in a picture, and for zooming, scale the single picture.

Addition, if zooming larger than the high resolution picture allows, go back to drawing the way you used to before.
« Last Edit: January 05, 2013, 03:44:11 pm by User137 »

jarto

  • Full Member
  • ***
  • Posts: 106
Re: Font Size in decimals
« Reply #2 on: January 05, 2013, 12:34:35 pm »
Hi, I'm creating a "Print Preview" image using BGRABitmap, and noted FontSize is defined in Integer, this is causing the text doesn't look accurate, compared to the final printed page.

One good way to solve this is to output text on screen one character at a time and counting the Y-coordinate by using Printer.TextWidth of whatever has been printed so far. That eliminates the small differences in font widths between screen and printer fonts.

circular

  • Hero Member
  • *****
  • Posts: 4471
    • Personal webpage
Re: Font Size in decimals
« Reply #3 on: January 08, 2013, 09:47:46 pm »
You can use the TBGRAVectorizedFont from BGRAVectorize.

See here : http://www.lazarus.freepascal.org/index.php/topic,12390.msg106188.html#msg106188
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018