Recent

Author Topic: Can you change font width on a ttf font in lazarus??  (Read 6529 times)

wpflum

  • Sr. Member
  • ****
  • Posts: 287
Can you change font width on a ttf font in lazarus??
« on: October 15, 2010, 05:05:45 pm »
I have an application that needs a specific width/height font size to fit into an image of a pre-printed form.  I see that I can change the height of a font but is there any way to change both height and width??  I found a font that closely resembles the original dot matrix font used on the real form but the geometry is off so if I have the correct height it's too wide or if I set the correct width then it's to short.  The font should look OK if i could 'squash' it horizontally but I don't see a way to do that in lazarus/freepascal .  I am currently trying to build a font from a sample printout from the printer itself but I'm having a steep learning curve with the ttf creation software and it's going to take a lot of time to get something I can use so I'd rather take the existing font and use it if possible.

Ideas??

eny

  • Hero Member
  • *****
  • Posts: 1662
Re: Can you change font width on a ttf font in lazarus??
« Reply #1 on: October 15, 2010, 05:37:14 pm »
Thinking outside the box  :D

You could create a bitmap, print the text in the requested font in either the right height or width.
Then scale the image to the right size to squeeze it into the area on your form.
All posts based on: Win11; stable Lazarus 4_4  (x64) 2026-02-12 (unless specified otherwise...)

mas steindorff

  • Hero Member
  • *****
  • Posts: 566
Re: Can you change font width on a ttf font in lazarus??
« Reply #2 on: October 15, 2010, 06:27:27 pm »
You could create a bitmap, print the text in the requested font in either the right height or width.
Then scale the image to the right size to squeeze it into the area on your form.
With this approch, you may be able to use a scaner to get the old printout/ font's into your computer.
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

 

TinyPortal © 2005-2018