How to set the PostScript language, the maximum width of the text?

I need a certain kind of PS file, which will later be korrelirovalisj in PDF
Write code in PostScripte.
In the code I draw a black rectangle 5*3.5 mm. In the center place the text. It is necessary that the text took across the width not more than 4.5 mm. i.e., if it exceeds this size, the text was compressed to 4.5.
How to do that?
April 3rd 20 at 17:16
1 answer
April 3rd 20 at 17:18
Read the metrics of the font, which will be made the inscription.
Counting the resulting length of the label.
Set the scale width to fit in the right place.
Gradually understand that this is not Corel some, ready, did not deliver.
I.e. the width for each character in different registers of a particular font.
Oh. Dreary how. - misael79 commented on April 3rd 20 at 17:21
@misael79, no, not really. Once create a table of 256 characters (for their code pages), the rest will be done by the computer. Rip metrics of the font, for example, FontForge, save it in .pfm, as I recall.
Oh, and a little math. - Teresa.Cummings commented on April 3rd 20 at 17:24

Find more questions by tags PDF